[PATCH] Fix references to __ehdr_start when it cannot be defined
Maciej W. Rozycki
macro@codesourcery.com
Fri Nov 8 00:45:00 GMT 2013
On Thu, 7 Nov 2013, Roland McGrath wrote:
> I don't know why the call was put where it was (the before_allocation hook)
> rather than where I moved it (the place where the __ehdr_start symbol is
> created) and the latter seems the far more obvious thing to do, so perhaps
> there is some reason the former is better that I don't understand.
Unfortunately this regresses the MIPS tests that I added back when making
the original fix -- for the very reason the fix was placed where it was
(please see http://sourceware.org/ml/binutils/2013-04/msg00260.html and
http://sourceware.org/bugzilla/show_bug.cgi?id=15365 for further
reference):
mips-linux-gnu-ld: not enough GOT space for local GOT entries
mips-linux-gnu-ld: BFD 2.24.51.20131107 internal error, aborting at .../bfd/elfxx-mips.c line 10042 in _bfd_mips_elf_relocate_section
mips-linux-gnu-ld: Please report this bug.
FAIL: MIPS magic __ehdr_start symbol test 1 (o32)
and likewise:
FAIL: MIPS magic __ehdr_start symbol test 2 (o32)
FAIL: MIPS magic __ehdr_start symbol test 1 (n32)
FAIL: MIPS magic __ehdr_start symbol test 1 (n64)
Please try finding a better fix that can decide whether __ehdr_start can
or cannot be defined no later in the link flow than where I put my change,
i.e. before bfd_elf_size_dynamic_sections has been called. All symbols
and their bindings have to be known by the time that function is called,
you cannot add any symbols later on.
> I have tested this only for {x86_64,i386}-{linux-gnu,nacl} targets.
> I am not set up to test any mips targets.
Setting up testing binutils e.g. for mips-linux-gnu should be fairly
straightforward (unlike with other pieces of the toolchain), e.g.:
$ cd path/to/binutils
$ mkdir obj
$ cd obj
$ ../configure --target=mips-linux-gnu
$ make
$ make -k -i check
And in any case for changes touching generic pieces of binutils I
recommend regression-testing across a reasonable number of targets, e.g.
I've been using a script that Alan Modra posted here a while ago
(attached). I have modified it a bit to add some more MIPS targets;
please feel free to tweak the list to suit your needs (and set --build
appropriately).
Maciej
-------------- next part --------------
A non-text attachment was scrubbed...
Name: binutils-test.sh
Type: application/x-sh
Size: 2994 bytes
Desc:
URL: <https://sourceware.org/pipermail/binutils/attachments/20131108/0fe3a469/attachment.sh>
More information about the Binutils
mailing list