New x86 linker testsuite failure

Alan Modra amodra@gmail.com
Fri Jun 29 06:07:00 GMT 2018


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
-------------- next part --------------
aarch64-linux aarch64_be-linux-gnu_ilp32 alpha-dec-vms alpha-linux alpha-linuxecoff alpha-netbsd alpha-unknown-freebsd4.7 am33_2.0-linux arc-linux-uclibc arm-linuxeabi arm-nacl arm-netbsdelf arm-nto arm-pe arm-symbianelf arm-vxworks arm-wince-pe armeb-linuxeabi avr-elf bfin-elf cr16-elf cris-elf cris-linux crisv32-linux crx-elf d10v-elf d30v-elf dlx-elf epiphany-elf fr30-elf frv-elf frv-linux ft32-elf h8300-elf hppa-linux hppa-hp-hpux10 hppa64-hp-hpux11.23 hppa64-linux i386-darwin i386-lynxos i586-linux i686-nacl i686-pc-beos i686-pc-elf i686-pe i686-vxworks ia64-elf ia64-freebsd5 ia64-hpux ia64-linux ia64-netbsd ia64-vms ip2k-elf iq2000-elf lm32-elf lm32-linux m32c-elf m32r-elf m32r-linux m68hc11-elf m68hc12-elf m68k-elf m68k-linux mcore-elf mcore-pe mep-elf metag-linux microblaze-elf microblaze-linux mips-linux mips-vxworks mips64el-openbsd mips64-openbsd mips64-linux mipsel-linux-gnu mipsisa32el-linux mipstx39-elf mmix mn10200-elf mn10300-elf moxie-elf ms1-elf msp430-elf mt-elf nds32be-elf nds32le-linux nios2-linux or1k-elf or1k-linux pdp11-dec-aout pj-elf powerpc-aix5.1 powerpc-aix5.2 powerpc-eabisim powerpc-eabivle powerpc-freebsd powerpc-linux powerpc-nto powerpc-wrs-vxworks powerpc64-freebsd powerpc64-linux powerpcle-elf powerpcle-cygwin powerpc64le-linux ppc-lynxos pru-elf riscv32-elf riscv64-elf rl78-elf rs6000-aix4.3.3 rs6000-aix5.1 rs6000-aix5.2 rx-elf s390-linux s390x-linux score-elf sh-linux sh-nto sh-pe sh-rtems sh-vxworks shl-unknown-netbsdelf sparc-elf sparc-linux sparc-vxworks sparc64-linux spu-elf tic30-unknown-aout tic30-unknown-coff tic4x-coff tic54x-coff tic6x-elf tilegx-linux tilepro-linux v850-elf vax-netbsdelf visium-elf x86_64-linux x86_64-pc-linux-gnux32 x86_64-w64-mingw32 x86_64-nacl xgate-elf xstormy16-elf xtensa-elf z8k-coff z80-coff


More information about the Binutils mailing list