[PATCH + test RFA] MIPS/LD: Fix crashing with a discarded dynamic relocation section

H.J. Lu hjl.tools@gmail.com
Fri Jul 20 12:57:00 GMT 2018


On Fri, Jul 20, 2018 at 5:30 AM, Maciej W. Rozycki <macro@mips.com> wrote:
> Hi Nick,
>
>> Approved.  Better to have a testcase that fails than a problem that
>> no-one knows about...
>
>  Applied then, thanks for the quick review.  I keep being confused about
> our XFAIL policy (and myself I tend to forget about things that have been
> XFAILed and never get back to them, so they never get fixed, unless
> perhaps by chance if I come across the same problem elsewhere).
>
>   Maciej

On x86-64, I got

regexp_diff match failure
regexp "^There are no dynamic relocations in this file\.$"
line   "'RELA' relocation section at offset 0x70 contains 24 bytes:"
extra lines in tmpdir/dump.out starting with "^  Offset          Info
         Type           Sym. Value    Sym. Name + Addend$"
EOF from /export/gnu/import/git/sources/binutils-gdb/ld/testsuite/ld-elf/reloc-discard.d
FAIL: Discarded dynamic relocation section

[hjl@gnu-cfl-1 ld]$ cat 1
/export/build/gnu/binutils-gold/build-x86_64-linux/ld/../gas/as-new
--defsym ALIGN=3   -o tmpdir/reloc-discard.o
/export/gnu/import/git/sources/binutils-gdb/ld/testsuite/ld-elf/reloc-discard.s
./ld-new -z norelro
-L/export/gnu/import/git/sources/binutils-gdb/ld/testsuite/ld-elf
-shared -T reloc-discard.ld -o tmpdir/dump tmpdir/reloc-discard.o
/export/build/gnu/binutils-gold/build-x86_64-linux/ld/../binutils/readelf
 -r --use-dynamic tmpdir/dump
[hjl@gnu-cfl-1 ld]$ sh 1

'RELA' relocation section at offset 0x70 contains 24 bytes:
  Offset          Info           Type           Sym. Value    Sym. Name + Addend
000000000088  000100000001 R_X86_64_64       0000000000000000 foo + 0
[hjl@gnu-cfl-1 ld]$


-- 
H.J.



More information about the Binutils mailing list