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: problem with binutils 2.29 for microblaze


On Sat, Aug 05, 2017 at 08:04:18PM +0200, Waldemar Brodkorb wrote:
> Hi,
> 
> This issue was reported in Januar:
> https://sourceware.org/bugzilla/show_bug.cgi?id=21017
> 
> 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:
> https://debug.openadk.org/microblaze/
> 
> 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.

> https://cgit.openadk.org/cgi/cgit/uclibc-ng.git/tree/ldso/ldso/dl-startup.c#n262
> 
> 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,
>  Waldemar

-- 
Alan Modra
Australia Development Lab, IBM


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