Regressions with "PATCH: PR ld/13177: garbage collector retains zombie references to external libraries"

H.J. Lu hjl.tools@gmail.com
Fri Sep 16 16:08:00 GMT 2011


On Fri, Sep 16, 2011 at 7:45 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, Sep 15, 2011 at 11:21 PM, Hans-Peter Nilsson
> <hans-peter.nilsson@axis.com> wrote:
>>> Date: Wed, 14 Sep 2011 12:14:38 -0700
>>> From: "H.J. Lu" <hongjiu.lu@intel.com>
>>
>>> 2011-09-14  H.J. Lu  <hongjiu.lu@intel.com>
>>>
>>>       PR ld/13177
>>>       * elflink.c (elf_gc_sweep_symbol): Also hide symbols without PLT
>>>       nor GOT references.
>>>
>>> ld/testsuite/
>>>
>>> 2011-09-14  H.J. Lu  <hongjiu.lu@intel.com>
>>>
>>>       PR ld/13177
>>>       * ld-elf/pr13177.d: New.
>>>       * ld-elf/pr13177.s: Likewise.
>>
>> Caused regressions for cris-elf and cris-axis-linux-gnu:
>>
>> cris-elf:
>> Running /tmp/hpautotest-binutils/bsrc/src/ld/testsuite/ld-cris/cris.exp ...
>> FAIL: ld-cris/pic-gc-72
>>
>> ld.log:
>> Executing on host: sh -c {/tmp/hpautotest-binutils/cris-axis-elf/ld/../binutils/objdump  -s -t -R -p -T tmpdir/dump > tmpdir/dump.out 2>ld.tmp}  /dev/null  (timeout = 300)
>> exited abnormally with 0, output:BFD: tmpdir/dump(.rela.dyn): relocation 0 has invalid symbol index 16777215
>
> This looks an cris backend bug.
>
>> ...
>> Running /tmp/hpautotest-binutils/bsrc/src/ld/testsuite/ld-elf/elf.exp ...
>> FAIL: ld-elf/pr12975
>>
>> ld.log:
>> ./ld-new  -L/tmp/hpautotest-binutils/bsrc/src/ld/testsuite/ld-elf  --gc-sections -shared -version-script pr12975.t -o tmpdir/dump tmpdir/dump0.o
>> Executing on host: sh -c {./ld-new  -L/tmp/hpautotest-binutils/bsrc/src/ld/testsuite/ld-elf  --gc-sections -shared -version-script pr12975.t -o tmpdir/dump tmpdir/dump0.o  2>&1}  /dev/null ld.tmp (timeout = 300)
>> ./ld-new: -shared not supported
>>
>> Your test wrongly assumes that all ELF target support -shared or
>> at least don't complain.  Other tests don't fall for that.
>>
>> FAIL: ld-elf/pr13177
>>
>> Same here.
>>
>> cris-axis-linux-gnu:
>> Running /tmp/hpautotest-binutils/bsrc/src/ld/testsuite/ld-cris/cris.exp ...
>> FAIL: ld-cris/pic-gc-72
>> ld.log says the same as for cris-elf for this FAIL.
>>
>> Running /tmp/hpautotest-binutils/bsrc/src/ld/testsuite/ld-elf/elf.exp ...
>> FAIL: ld-elf/pr13177
>>
>> ld.log:
>> ./ld-new  -L/tmp/hpautotest-binutils/bsrc/src/ld/testsuite/ld-elf  --gc-sections -shared -o tmpdir/dump tmpdir/dump0.o
>> Executing on host: sh -c {./ld-new  -L/tmp/hpautotest-binutils/bsrc/src/ld/testsuite/ld-elf  --gc-sections -shared -o tmpdir/dump tmpdir/dump0.o  2>&1}  /dev/null ld.tmp (timeout = 300)
>> ./ld-new: tmpdir/dump0.o, section .text.opt_out:
>>  relocation R_CRIS_32 should not be used in a shared object; recompile with -fPIC
>> succeeded with: <./ld-new: tmpdir/dump0.o, section .text.opt_out:
>>  relocation R_CRIS_32 should not be used in a shared object; recompile with -fPIC>, expected: <>
>> ./ld-new: tmpdir/dump0.o, section .text.opt_out:
>>  relocation R_CRIS_32 should not be used in a shared object; recompile with -fPIC
>> succeeded with: <./ld-new: tmpdir/dump0.o, section .text.opt_out:
>>  relocation R_CRIS_32 should not be used in a shared object; recompile with -fPIC>, expected: <>
>>
>> Looks like the test emits an absolute address in .text in a
>> shared library, a no-no.  Try using .data instead or something.
>> Don't x86_64 and sh err too?
>>
>
> I can limit it to Linux.

I checked in this patch.


-- 
H.J.
---
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index c5349be..be38879 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2011-09-16  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* ld-elf/pr12975.d: Only run for *-*-linux* and *-*-gnu*
+	targets.
+	* ld-elf/pr13177.d: Likewise.
+
+	* ld-elf/pr13177.s: Avoid relocations in text sections.
+
 2011-09-15  H.J. Lu  <hongjiu.lu@intel.com>

 	PR ld/13177
diff --git a/ld/testsuite/ld-elf/pr12975.d b/ld/testsuite/ld-elf/pr12975.d
index 549e8d5..b361cc2 100644
--- a/ld/testsuite/ld-elf/pr12975.d
+++ b/ld/testsuite/ld-elf/pr12975.d
@@ -1,5 +1,6 @@
 #ld: --gc-sections -shared -version-script pr12975.t
 #readelf: -s --wide
+#target: *-*-linux* *-*-gnu*
 #notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-*
 #notarget: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
 # generic linker targets don't support --gc-sections, nor do a bunch of others
diff --git a/ld/testsuite/ld-elf/pr13177.d b/ld/testsuite/ld-elf/pr13177.d
index 425a239..e56e865 100644
--- a/ld/testsuite/ld-elf/pr13177.d
+++ b/ld/testsuite/ld-elf/pr13177.d
@@ -1,6 +1,7 @@
 #source: pr13177.s
 #ld: --gc-sections -shared
 #readelf: -s -D --wide
+#target: *-*-linux* *-*-gnu*
 #notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-*
 #notarget: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
 # generic linker targets don't support --gc-sections, nor do a bunch of others
diff --git a/ld/testsuite/ld-elf/pr13177.s b/ld/testsuite/ld-elf/pr13177.s
index 25232ba..d7caad3 100644
--- a/ld/testsuite/ld-elf/pr13177.s
+++ b/ld/testsuite/ld-elf/pr13177.s
@@ -3,7 +3,7 @@
 	.type	foo, %function
 foo:
 	.byte 0
-	.section .text.opt_out,"ax",%progbits
-	.type	opt_out, %function
+	.section .data.opt_out,"aw",%progbits
+	.type	opt_out, %object
 opt_out:
 	.dc.a bar



More information about the Binutils mailing list