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: New x86 linker testsuite failure


On Thu, Jun 28, 2018 at 03:03:12PM +0000, Alan Hayward wrote:
> 
> 
> > On 28 Jun 2018, at 05:03, Alan Modra <amodra@gmail.com> wrote:
> > 
> > On Wed, Jun 27, 2018 at 01:35:53PM +0000, Alan Hayward wrote:
> >> Is the following patch ok?
> > 
> > No.  With changes like this you really do need to run the testsuite
> > over all supported ELF targets.
> > 
> 
> Ok.
> 
> >> This both restores my previous code and fixes
> >> up the macros. Ensured the ld alloc test now passes and the gdb works with
> >> armlinker binaries.
> > 
> > The patch results in some testsuite failures.
> > 
> > alpha-linux  +FAIL: ld-elf/mbind1b
> > alpha-linux  +FAIL: ld-elf/mbind1c
> > i686-nacl  +FAIL: strip -shared (maxpage1)
> > i686-nacl  +FAIL: objcopy -shared (maxpage1)
> > i686-nacl  +FAIL: objcopy -shared -z noseparate-code (tdata2)
> > i686-nacl  +FAIL: objcopy -shared -z separate-code (tdata2)
> > i686-nacl  +FAIL: objcopy -shared -z noseparate-code (tbss2)
> > i686-nacl  +FAIL: objcopy -shared -z separate-code (tbss2)
> > rx-elf  +XPASS: ld-scripts/rgn-at9
> > x86_64-nacl  +FAIL: strip -shared (maxpage1)
> > x86_64-nacl  +FAIL: objcopy -shared (maxpage1)
> > x86_64-nacl  +FAIL: objcopy -shared -z noseparate-code (tdata2)
> > x86_64-nacl  +FAIL: objcopy -shared -z separate-code (tdata2)
> > x86_64-nacl  +FAIL: objcopy -shared -z noseparate-code (tbss2)
> > x86_64-nacl  +FAIL: objcopy -shared -z separate-code (tbss2)
> > 
> 
> Is there anything you can point me at for easily compiling the nacl versions?
> And/or anywhere that lists all the targets I should be testing?

I configure with
~/src/binutils-gdb/configure --enable-plugins --disable-gdb --disable-sim --disable-readline --disable-libdecnumber --target=... &> make.log
then "make &>> make.log && make -k check &> check.log".

My current set of targets is attached.  For some I have cross
compilers and libc installed, but that isn't really needed.

[snip]
> A zero sized section does sound very odd.

Actually it's quite common.  For instance, the GNU assembler always
creates .text, .data, and .bss regardless of whether they are used.
The linker also creates some sections before they are known to be
needed.  Most are stripped if unneeded nowadays, but there are a few
that escape stripping due to KEEP in a linker script or for other
reasons.

> At this point I’m not convinced that adding a “if size is 0 then use addresses
> instead of offsets” is the solution - feels like I’m weaving around corner
> cases. I will have to think about this some more.

Given two load segments tightly packed on disk (ie. seg1.p_offset +
seg1.p_filesz == seg2.p_offset) and a zero size section with
sh_offset == seg2.p_offset how else can you reliably determine whether
the section belongs at the end of seg1 or at the beginning of seg2?

> If I did get a valid solution soon is there a chance it could get into 2.31
> or has that been missed now?

Given the fragility of this code, I think any solution that modifies
ELF_SECTION_IN_SEGMENT* has no chance.  A solution that analyzes
sections/segments before ELF_SECTION_IN_SEGMENT is invoked and then
modifies the check_vma argument might be acceptable.

-- 
Alan Modra
Australia Development Lab, IBM

Attachment: targets
Description: Text document


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