This is the mail archive of the
mailing list for the binutils project.
Re: problem with binutils 2.29 for microblaze
- From: Alan Modra <amodra at gmail dot com>
- To: Waldemar Brodkorb <wbx at openadk dot org>
- Cc: binutils at sourceware dot org, Thomas Petazzoni <thomas dot petazzoni at free-electrons dot com>, Rich Felker <dalias at libc dot org>
- Date: Sun, 6 Aug 2017 10:21:27 +0930
- Subject: Re: problem with binutils 2.29 for microblaze
- Authentication-results: sourceware.org; auth=none
- References: <20170805180418.GC16580@waldemar-brodkorb.de>
On Sat, Aug 05, 2017 at 08:04:18PM +0200, Waldemar Brodkorb wrote:
> This issue was reported in Januar:
> I reported the musl build failure via IRC to Rich.
> He opened up the ticket and suggested a fix.
> The fix is included in Binutils 2.29.
> Unfortunately it breaks uClibc-ng shared library loader.
Yes, the binutils patch is incorrect. It causes got.refcount to be
incremented for a GOTOFF relocation, when such relocations should not
cause a GOT entry to be created. Easily fixed.
The patch also raises other interesting questions, like: If GOTOFF_64
needs a GOT section to be created in order to define
_GLOBAL_OFFSET_TABLE_, then what about GOTOFF_32? Also, why is
can_gc_sections set without gc_sweep_hook being implemented?
> You can find Qemu bootable rootfs here:
> Bad does not boot and contains the commit in binutils, which
> generates the binaries and libraries.
> Good does boot and does not contain the commit in binutils.
> Interesting is that ld.bad (readelf -aW output) of ld.so
> contains a R_MICROBLAZE_NONE relocation. I think that's
> the reason why ld.so can not selfrelocate/bootstrap.
> For the broken rootfs the last message I see
> is "About to do library loader relocations"
>From a quick look at uclibc-ng support for microblaze, I see that
PERFORM_BOOTSTRAP_RELOC in ldso/ldso/microblaze/dl-startup.h only
handles R_MICROBLAZE_REL. Your conclusion that R_MICROBLAZE_NONE
breaks ld.so self relocation is correct.
> So is it a bug in uClibc-ng ld.so or a bug in binutils?
Both, I would say. uclibc-ng for not handling _NONE relocs, binutils
for generating them in the first place.
> What information you need for helping me with this issue?
> Thanks for any hints,
Australia Development Lab, IBM