This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GNU Binutils 2.33.1 has been released.


Hi Nick, All,

Le 14/10/2019 à 12:44, Nick Clifton a écrit :
> Hi Romain,
> 
>> I tested this new version using toolchain-builder project [1] and discovered
>> some regressions on arm cortex-m4 and SH4 architectures.
> 
>> There is a segfault in elf2flt while building busybox:
>> "ld (ld-elf2flt):
>> /builds/kubu93/toolchains-builder/build/opt/armv7m--uclibc--bleeding-edge-2/arm-buildroot-uclinux-uclibcgnueabi/bin/elf2flt
> 
> Hmm, that is worrying, but I suppose that it could be a bug in
> elf2flt rather than the binutils.  Maybe...
> 
> Is this problem specific to the ARM architecture ?  (Ie does elf2flt
> work when compiled and run for other architecures ?)  If so, then I
> would suspect a problem with the changes to the ARM specific code in
> the BFD library, and I would probably ask one of the ARM regulars to
> take a look.  (Hi Tamar...)
> 
> Are you able to find out where the segmentation fault is occurring ?
> Is it inside the BFD library somewhere ?

This issue has been resolved in elf2flt:

https://github.com/uclinux-dev/elf2flt/issues/12

> 
> 
>> - sh4 [4]: (sh4, binutils 2.33.1, kernel headers 4.19.79, Glibc | uClibc-ng |
>> musl, Qemu 3.1)
>>
>> The system doesn't boot under Qemu.
> 
> *sigh* This one will probably be even harder to investigate.  Not being
> familiar with Qemu, I do not what the best approach would be.  Can we get
> it to tell us why the boot fails ?  Does it think that a binary is invalid
> somehow ?

For this issue I used git bisect on binutils source between 2.32 and 2.33.
Finally the issue come from this commit [1]:

"PR24311, FAIL: S-records with constructors

Not padding string merge section output to its alignment can cause
failures of the S-record tests when input string merge sections are
padded, since the ELF linker output for the single string section
would shrink compared to the SREC linker output.  That might result in
following sections having different addresses.
On the other hand, padding string merge section output when input
string merge sections are *not* padded can also cause failures, in
this case due to the ELF linker output for the string section being
larger (due to padding) than the SREC linker output.

It would be better to write a more robust test, but it is also nice
to leave input unchanged when no string merges occur."


How to reproduce:

   git clone https://github.com/RomainNaour/buildroot.git buildroot
   cd buildroot
   git checkout binutils-2.33.1

   make qemu_sh4_r2d_defconfig
   make menuconfig

   In the toolchain menu, change binutils version to 2.33.1.
   (I used gcc 9.2 for my tests, so you can also set the gcc version to 9.2)

   make

   qemu-system-sh4 -M r2d -kernel output/images/zImage -drive
file=output/images/rootfs.ext2,if=ide,format=raw -append "rootwait root=/dev/sda
console=ttySC1,115200 noiotrap" -serial null -serial stdio -net
nic,model=rtl8139 -net user

The system doesn't boot but if It I revert the commit [1], the system boot.

Since it's a commit not related to sh4, it's weird that is the only affected
architecture.

[1]
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ebd2263ba9a9124d93bbc0ece63d7e0fae89b40e

Best regards,
Romain

> 
> Cheers
>   Nick
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]