bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/17094] New: bfd fails to parse ELF objects made with gas


From: andrel at cybernoia dot de
Subject: [Bug binutils/17094] New: bfd fails to parse ELF objects made with gas
Date: Thu, 26 Jun 2014 12:51:52 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=17094

            Bug ID: 17094
           Summary: bfd fails to parse ELF objects made with gas
           Product: binutils
           Version: 2.24
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: andrel at cybernoia dot de

Created attachment 7659
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7659&action=edit
Patch that makes _bfd_elf_make_section_from_shdr() not fail when sh_addralign
is 0 or 1

Preamble: I'm being a bit verbose here because it's the first time I dig deep
into a toolchain and maybe I'm just too stupid to see the obvious...

My goal is to build a toolchain for a little-endian ARM 926ej-s CPU.
Buildsystem is a x86_64-pc-linux-gnu. I built the binutils 2.24.0 and gcc
4.9.0. Building glibc then failed in configure script with

checking for .preinit_array/.init_array/.fini_array support... no
configure: error: Need linker with .init_array/.fini_array support.

It turned out that my gcc could not even compile the most simple file because a
temporary file created by gas could later not be read by ld ("file not
recognized: Bad value"). Digging deeper, I noticed that when doing "make
check-gas" in binutils, almost half of the tests failed.

Debugging the stuff, I found that _bfd_elf_make_section_from_shdr() fails when
bfd_set_section_alignment() fails. That function however only returns the
alignment found, and according to the description of sh_addralign in "man 5
elf", 0 is a valid value for that.

With attached patch, "make check-gas" succeeds in all test cases and I can
build a glibc. Due to other problems I could not build a full toolchain yet, so
please be careful with the patch..

Thanks!

PS: here's the configure line I used for binutils:
./configure --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=arm-926ejs-linux-gnueabi
--prefix=/usr/local/arm/cross-gcc-4.9.0-armv5te-soft/x86_64-pc-linux-gnu
--enable-serial-configure
--with-sysroot=/usr/local/arm/cross-gcc-4.9.0-armv5te-soft/x86_64-pc-linux-gnu/arm-926ejs-linux-gnueabi/sys-root
-v

-- 
You are receiving this mail because:
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]