This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Fix removed sections (Re: 2.12.90.0.12 Kernel Miscompile)
Thanks for sorting out the mess I caused.
Here's a dejagnu version of the test case. It all hinges on the
placement of .rel* sections after .rodata, which was what was
happening in the linux case. OK to install?
Richard
[ld/testsuite]
* ld-scripts/dynamic-sections*: New test.
*** /dev/null Tue Nov 14 21:44:43 2000
--- ld/testsuite/ld-scripts/dynamic-sections-1.s Mon Jul 8 18:38:25 2002
***************
*** 0 ****
--- 1,2 ----
+ .data
+ .4byte foo
*** /dev/null Tue Nov 14 21:44:43 2000
--- ld/testsuite/ld-scripts/dynamic-sections-2.s Mon Jul 8 18:34:06 2002
***************
*** 0 ****
--- 1,3 ----
+ .data
+ .global foo
+ foo: .4byte 0
*** /dev/null Tue Nov 14 21:44:43 2000
--- ld/testsuite/ld-scripts/dynamic-sections.d Mon Jul 8 18:33:38 2002
***************
*** 0 ****
--- 1,6 ----
+ # nm: -C
+ # ld: -T dynamic-sections.t
+ # name: dynamic sections
+ # source: dynamic-sections-1.s
+ # source: dynamic-sections-2.s
+ #pass
*** /dev/null Tue Nov 14 21:44:43 2000
--- ld/testsuite/ld-scripts/dynamic-sections.exp Mon Jul 8 18:39:07 2002
***************
*** 0 ****
--- 1,8 ----
+ # Check for bug introduced on 2002-06-10. See dynamic-sections.t for
+ # more details
+
+ if ![is_elf_format] {
+ return
+ }
+
+ run_dump_test dynamic-sections
*** /dev/null Tue Nov 14 21:44:43 2000
--- ld/testsuite/ld-scripts/dynamic-sections.t Mon Jul 8 18:39:29 2002
***************
*** 0 ****
--- 1,11 ----
+ SECTIONS
+ {
+ .data : { *(.data) }
+ .rodata : { *(.rodata) }
+
+ /* The .rel* sections are typically placed here, because of the way
+ elf32.em handles orphaned sections. A bug introduced on 2002-06-10
+ would cause . to be 0 at this point. */
+
+ _bar = ASSERT (. > 0, "Bad . value");
+ }