This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: ld-scripts/phdrs2.exp failed on many platforms
- From: Nick Clifton <nickc at cambridge dot redhat dot com>
- To: dlheine at tensilica dot com, hjl at lucon dot org
- Cc: binutils at sources dot redhat dot com
- Date: 07 Jun 2002 11:31:02 +0100
- Subject: Re: ld-scripts/phdrs2.exp failed on many platforms
- References: <20020606125821.A1588@lucon.org>
Hi H.J.
> Your ld-scripts/phdrs2.exp failed on
>
> ./build-alpha-linux/ld/ld.log:FAIL: PHDRS2
> ./build-arm-linux/ld/ld.log:FAIL: PHDRS2
> ./build-ia64-linux/ld/ld.log:FAIL: PHDRS2
> ./build-mips-linux/ld/ld.log:FAIL: PHDRS2
> ./build-mips64-linux/ld/ld.log:FAIL: PHDRS2
> ./build-mips64el-linux/ld/ld.log:FAIL: PHDRS2
> ./build-mipsel-linux/ld/ld.log:FAIL: PHDRS2
> ./build-ppc-linux/ld/ld.log:FAIL: PHDRS2
> ./build-sh-linux/ld/ld.log:FAIL: PHDRS2
I took a look at this. The problem is that the phdrs2.s script was
using the .align directive, which behaves differently for different
targets. Plus it was using the .text and .data sections which can
have special semantics for some targets. So I have applied the patch
below and run tests on lots of different platforms, including all of
those mentioned above, and there should be no more failures.
Cheers
Nick
2002-06-07 Nick Clifton <nickc@cambridge.redhat.com>
* ld-scripts/phdrs2.s: Use .p2align instead of .align.
Use section names .foo and .bar instead of .text and .data.
* ld-scripts/phdrs2.t: Refer to .foo and .bar instead of .text
and .data.
Index: phdrs2.s
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-scripts/phdrs2.s,v
retrieving revision 1.1
diff -c -3 -p -w -r1.1 phdrs2.s
*** phdrs2.s 6 Jun 2002 10:03:38 -0000 1.1
--- phdrs2.s 7 Jun 2002 10:13:20 -0000
***************
*** 1,7 ****
! .text
! .align 4
.long 1
! .data
! .align 4
.long 2
--- 1,7 ----
! .section .foo, "ax"
! .p2align 2
.long 1
! .section .bar, "aw"
! .p2align 2
.long 2
Index: phdrs2.t
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-scripts/phdrs2.t,v
retrieving revision 1.1
diff -c -3 -p -w -r1.1 phdrs2.t
*** phdrs2.t 6 Jun 2002 10:03:38 -0000 1.1
--- phdrs2.t 7 Jun 2002 10:13:20 -0000
***************
*** 1,23 ****
PHDRS
{
! text PT_LOAD ;
! data PT_LOAD ;
}
SECTIONS
{
. = 0x800000 - 1;
! /* The PHDRS generated should start at the aligned .text section
address, not the unaligned .empty section address */
.empty : {
EMPTY_START = ABSOLUTE(.) ;
*(.empty)
EMPTY_END = ABSOLUTE(.) ;
! } : text
! .text : { *(.text) } :text
! .data : { *(.data)
LONG(EMPTY_START) ;
! } :data
/DISCARD/ : { *(.*) }
}
--- 1,23 ----
PHDRS
{
! Foo PT_LOAD ;
! Bar PT_LOAD ;
}
SECTIONS
{
. = 0x800000 - 1;
! /* The PHDRS generated should start at the aligned .foo section
address, not the unaligned .empty section address */
.empty : {
EMPTY_START = ABSOLUTE(.) ;
*(.empty)
EMPTY_END = ABSOLUTE(.) ;
! } : Foo
! .foo : { *(.foo) } : Foo
! .bar : { *(.bar)
LONG(EMPTY_START) ;
! } : Bar
/DISCARD/ : { *(.*) }
}