[PATCH] bfin: Check bfd_link_hash_indirect

Mike Frysinger vapier@gentoo.org
Tue Jan 12 06:49:03 GMT 2021


On 06 Jan 2021 18:21, Mike Frysinger via Binutils wrote:
> On 06 Jan 2021 05:24, H.J. Lu via Binutils wrote:
> > On Wed, Jan 6, 2021 at 4:16 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> > > On Wed, Jan 6, 2021 at 2:04 AM Mike Frysinger <vapier@gentoo.org> wrote:
> > > > On 29 Dec 2020 10:45, H.J. Lu via Binutils wrote:
> > > > > bfinfdpic_check_relocs shouldn't call bfd_elf_link_record_dynamic_symbol
> > > > > since it has been called from elf_link_add_object_symbols.  This fixed:
> > > > >
> > > > > FAIL: ld-elf/pr26979a
> > > > > FAIL: ld-elf/pr26979b
> > > > > FAIL: Symbol export class test (final shared object)
> > > >
> > > > seems to break FDPIC toolchains:
> > > > $ cat test.c
> > > > static int i = 3;
> > > > int main(int argc, char *argv[]) {
> > > >         return argc + i;
> > > > }
> > > >
> > > > $ bfin-linux-uclibc-gcc test.c
> > > > $ file a.out
> > > > a.out: ELF 32-bit LSB executable, Analog Devices Blackfin, version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, with debug_info, not stripped
> > > >
> > > > commit 865288236d881acecdcf0aaa636fd28fd811d862:
> > > > $ ln -s ld-new ld/ld
> > > > $ bfin-linux-uclibc-gcc -Bld test.c
> > > > <works>
> > > >
> > > > with your patch:
> > > > $ ln -s ld-new ld/ld
> > > > $ bfin-linux-uclibc-gcc -Bld test.c
> > > > ld/ld: BFD (GNU Binutils) 2.35.50.20210106 assertion fail ../../../bfd/elf32-bfin.c:2032
> > > > ld/ld: BFD (GNU Binutils) 2.35.50.20210106 assertion fail ../../../bfd/elf32-bfin.c:2032
> > > > ld/ld: BFD (GNU Binutils) 2.35.50.20210106 assertion fail ../../../bfd/elf32-bfin.c:2032
> > > > ld/ld: BFD (GNU Binutils) 2.35.50.20210106 assertion fail ../../../bfd/elf32-bfin.c:2023
> > > > ld/ld: BFD (GNU Binutils) 2.35.50.20210106 assertion fail ../../../bfd/elf32-bfin.c:2023
> > > > ld/ld: BFD (GNU Binutils) 2.35.50.20210106 assertion fail ../../../bfd/elf32-bfin.c:2023
> > > > ld/ld: LINKER BUG: .rofixup section size mismatch
> > >
> > > There is no testcase coverage for this case.
> > 
> > There are no bfin specific linker tests at all.
> 
> i'd believe it

hmm i just noticed in one of my local branches:
2010-12-09 12:06:51 -0500 ld: tests: more cross-testing
2010-12-09 12:06:34 -0500 ld: tests: add -msim when testing bfin targets

they're full of tweaks related to enabling testing of targets even when
they aren't native.  so i guess that explains a bit why we didn't have
great linker coverage for so long ... so many of the .exp files were
sprinkled with checks like:
	if ![isnative] then {return}

and we gave up a bit in hopelessness :).  i'll see if i can't dust some
of these off a bit as i think the ld tree has improved since.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <https://sourceware.org/pipermail/binutils/attachments/20210112/ae8b950a/attachment.sig>


More information about the Binutils mailing list