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: [PATCH] Fix references to __ehdr_start when it cannot be defined


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

Attachment: binutils-test.sh
Description: Bourne shell script


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