1 # Test PHDRS in a linker script.
2 # By Ian Lance Taylor, Cygnus Support.
4 # PHDRS is only meaningful for ELF.
5 if { ![istarget *-*-sysv4*] \
6 && ![istarget *-*-unixware*] \
7 && ![istarget *-*-elf*] \
8 && ![istarget *-*-linux*] \
9 && ![istarget *-*-irix5*] \
10 && ![istarget *-*-irix6*] \
11 && ![istarget *-*-solaris2*] } {
15 if { [istarget *-*-linuxaout*] \
16 || [istarget *-*-linuxoldld*] } {
20 # This is a very simplistic test.
24 if ![ld_assemble $as $srcdir/$subdir/phdrs.s tmpdir/phdrs.o] {
30 ".*Program Header:.*PHDR *off *0x00*34 *vaddr *0x00*80034 *paddr *0x00*80034.*filesz *0x0\[0-9a-f\]* *memsz *0x0\[0-9a-f\]* flags r--.*LOAD *off *0x00* *vaddr *0x00*80000 *paddr *0x00*80000.*filesz *0x00*\[0-9a-f\]* *memsz *0x0\[0-9a-f\]* *flags r-x.*LOAD *off *0x0\[0-9a-f\]* *vaddr *0x00*80*\[0-9a-f\]* *paddr *0x00*80*\[0-9a-f\]*.*filesz *0x0\[0-9a-f\]* *memsz *0x0\[0-9a-f\]* *flags *rw-.*"
32 if ![ld_simple_link $ld tmpdir/phdrs "-T $srcdir/$subdir/phdrs.t tmpdir/phdrs.o"] {
35 if {[which $objdump] == 0} {
40 verbose -log "$objdump --private tmpdir/phdrs"
41 catch "exec $objdump --private tmpdir/phdrs" exec_output
42 set exec_output [prune_system_crud $host_triplet $exec_output]
43 verbose -log $exec_output
45 if [regexp $phdrs_regexp $exec_output] {