This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH: Fix linker include-1 test
- From: Nick Clifton <nickc at redhat dot com>
- To: binutils at sourceware dot org
- Date: Mon, 21 Jul 2008 09:38:09 +0100
- Subject: PATCH: Fix linker include-1 test
Hi Guys,
I am applying the patch below to fix a few problems with the
include-1 test in the linker testsuite. The problems were that:
1) It did now allow for targets that automatically add extra
sections to the output binary. (Eg the ARM ports which add an
.ARM.attributes section).
2) It uses the .4byte assembler pseudo-op which is not supported
by all targets. Similarly the .section pseudo-op varies from
target to target, so I replaced its uses with just .text and
.data.
3) Some targets do not make the .text section readonly.
4) AIX targets rename the .text and .data sections.
Tested by running a full regression test for 105 different ports!
Cheers
Nick
ld/testsuite/ChangeLog
2008-07-21 Nick Clifton <nickc@redhat.com>
* ld-scripts/include-sections.t: Discard all sections not
explicitly requested by the rest of the linker script.
* ld-scripts/include-1.d: Expect test to fail for AIX ports.
Do not assume that the .text section will be marked readonly.
* ld-scripts/include.s: Replace .section directives with just
.text or .data.
Index: ld/testsuite/ld-scripts/include-1.d
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-scripts/include-1.d,v
retrieving revision 1.1
diff -c -3 -p -r1.1 include-1.d
*** ld/testsuite/ld-scripts/include-1.d 6 Jul 2008 13:38:37 -0000 1.1
--- ld/testsuite/ld-scripts/include-1.d 21 Jul 2008 08:25:27 -0000
***************
*** 2,11 ****
# source: include.s
# ld: -T include-1.t
# objdump: -w -h
.*: file format .*
Sections:
Idx +Name +Size +VMA +LMA +File off +Algn +Flags
! 0 .text 0+000000c 0+0000000 0+0000000 [0-9a-f]+ 2\*\*[0-9]+ CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .data 0+000000c 0+0100000 0+0100000 [0-9a-f]+ 2\*\*[0-9]+ CONTENTS, ALLOC, LOAD, DATA
--- 2,13 ----
# source: include.s
# ld: -T include-1.t
# objdump: -w -h
+ # xfail: "*-aix*"
+ # AIX targets rename the .text and .data sectons...
.*: file format .*
Sections:
Idx +Name +Size +VMA +LMA +File off +Algn +Flags
! 0 .text 0+000000c 0+0000000 0+0000000 [0-9a-f]+ 2\*\*[0-9]+ CONTENTS, ALLOC, LOAD,.*CODE
1 .data 0+000000c 0+0100000 0+0100000 [0-9a-f]+ 2\*\*[0-9]+ CONTENTS, ALLOC, LOAD, DATA
Index: ld/testsuite/ld-scripts/include-sections.t
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-scripts/include-sections.t,v
retrieving revision 1.1
diff -c -3 -p -r1.1 include-sections.t
*** ld/testsuite/ld-scripts/include-sections.t 6 Jul 2008 13:38:37 -0000 1.1
--- ld/testsuite/ld-scripts/include-sections.t 21 Jul 2008 08:25:27 -0000
***************
*** 1,4 ****
--- 1,5 ----
SECTIONS {
.text : { *(.text) } >rom
INCLUDE include-data.t
+ /DISCARD/ : { *(*) }
}