Browse Source

Re: Add --enable-linker-verssion

Output sections without any input sections to initialise their flags
have their flags initialised by data statements to LOAD, ALLOC,
HAS_CONTENTS by default.  This is wrong for .comment.  Fix that by
making the script initialise the section type to INFO, one of the
noalloc section types.  That also allows the address of .comment to be
set to zero, as is usual for non-alloc sections.

Also, use source_sh for all of the sourced scripts to set up make
dependencies.

	PR 30187
	* scripttempl/misc-sections.sc: Set .comment address to zero
	and type to INFO.
	* scripttempl/ft32.sc: Fix breakages from last edit.
	* scripttempl/arclinux.sc: Use source_sh to source DWARF.sc
	and misc-sections.sc.
	* scripttempl/avr.sc: Likewise.
	* scripttempl/dlx.sc: Likewise.
	* scripttempl/elf.sc: Likewise.
	* scripttempl/elf32cr16.sc: Likewise.
	* scripttempl/elf32crx.sc: Likewise.
	* scripttempl/elf32msp430.sc: Likewise.
	* scripttempl/elf64bpf.sc: Likewise.
	* scripttempl/elf64hppa.sc: Likewise.
	* scripttempl/elf_chaos.sc: Likewise.
	* scripttempl/elfarc.sc: Likewise.
	* scripttempl/elfarcv2.sc: Likewise.
	* scripttempl/elfd10v.sc: Likewise.
	* scripttempl/elfd30v.sc: Likewise.
	* scripttempl/elfm68hc11.sc: Likewise.
	* scripttempl/elfm68hc12.sc: Likewise.
	* scripttempl/elfm9s12z.sc: Likewise.
	* scripttempl/elfmicroblaze.sc: Likewise.
	* scripttempl/elfxgate.sc: Likewise.
	* scripttempl/elfxtensa.sc: Likewise.
	* scripttempl/epiphany_4x4.sc: Likewise.
	* scripttempl/i386beos.sc: Likewise.
	* scripttempl/i386go32.sc: Likewise.
	* scripttempl/ia64vms.sc: Likewise.
	* scripttempl/ip2k.sc: Likewise.
	* scripttempl/iq2000.sc: Likewise.
	* scripttempl/mep.sc: Likewise.
	* scripttempl/mmo.sc: Likewise.
	* scripttempl/nds32elf.sc: Likewise.
	* scripttempl/pru.sc: Likewise.
	* scripttempl/v850.sc: Likewise.
	* scripttempl/v850_rh850.sc: Likewise.
	* scripttempl/visium.sc: Likewise.
	* scripttempl/xstormy16.sc: Likewise.
	* scripttempl/z80.sc: Likewise.
	* testsuite/ld-scripts/ld-version-2.d: Don't skip ft32 or pru.
users/aburgess/try-core-file-pid0
Alan Modra 3 years ago
parent
commit
6752dd75f7
  1. 5
      ld/scripttempl/arclinux.sc
  2. 4
      ld/scripttempl/avr.sc
  3. 5
      ld/scripttempl/dlx.sc
  4. 5
      ld/scripttempl/elf.sc
  5. 4
      ld/scripttempl/elf32cr16.sc
  6. 4
      ld/scripttempl/elf32crx.sc
  7. 4
      ld/scripttempl/elf32msp430.sc
  8. 2
      ld/scripttempl/elf64bpf.sc
  9. 4
      ld/scripttempl/elf64hppa.sc
  10. 4
      ld/scripttempl/elf_chaos.sc
  11. 4
      ld/scripttempl/elfarc.sc
  12. 4
      ld/scripttempl/elfarcv2.sc
  13. 4
      ld/scripttempl/elfd10v.sc
  14. 4
      ld/scripttempl/elfd30v.sc
  15. 4
      ld/scripttempl/elfm68hc11.sc
  16. 4
      ld/scripttempl/elfm68hc12.sc
  17. 4
      ld/scripttempl/elfm9s12z.sc
  18. 4
      ld/scripttempl/elfmicroblaze.sc
  19. 4
      ld/scripttempl/elfxgate.sc
  20. 5
      ld/scripttempl/elfxtensa.sc
  21. 5
      ld/scripttempl/epiphany_4x4.sc
  22. 13
      ld/scripttempl/ft32.sc
  23. 2
      ld/scripttempl/i386beos.sc
  24. 2
      ld/scripttempl/i386go32.sc
  25. 2
      ld/scripttempl/ia64vms.sc
  26. 5
      ld/scripttempl/ip2k.sc
  27. 5
      ld/scripttempl/iq2000.sc
  28. 5
      ld/scripttempl/mep.sc
  29. 2
      ld/scripttempl/misc-sections.sc
  30. 2
      ld/scripttempl/mmo.sc
  31. 5
      ld/scripttempl/nds32elf.sc
  32. 5
      ld/scripttempl/pru.sc
  33. 5
      ld/scripttempl/v850.sc
  34. 5
      ld/scripttempl/v850_rh850.sc
  35. 2
      ld/scripttempl/visium.sc
  36. 5
      ld/scripttempl/xstormy16.sc
  37. 4
      ld/scripttempl/z80.sc
  38. 1
      ld/testsuite/ld-scripts/ld-version-2.d

5
ld/scripttempl/arclinux.sc

@ -656,9 +656,8 @@ EOF
test -z "${NON_ALLOC_DYN}" || emit_dyn
. $srcdir/scripttempl/misc-sections.sc
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
${ATTRS_SECTIONS}

4
ld/scripttempl/avr.sc

@ -328,13 +328,13 @@ cat <<EOF
EOF
fi
. $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/misc-sections.sc
cat <<EOF
.note.gnu.build-id ${RELOCATING-0} : { *(.note.gnu.build-id) }
EOF
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}

5
ld/scripttempl/dlx.sc

@ -41,9 +41,8 @@ SECTIONS
EOF
. $srcdir/scripttempl/misc-sections.sc
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}

5
ld/scripttempl/elf.sc

@ -722,9 +722,8 @@ EOF
test -z "${NON_ALLOC_DYN}" || emit_dyn
. $srcdir/scripttempl/misc-sections.sc
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
${ATTRS_SECTIONS}

4
ld/scripttempl/elf32cr16.sc

@ -171,8 +171,8 @@ SECTIONS
EOF
. $srcdir/scripttempl/misc-sections.sc
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}

4
ld/scripttempl/elf32crx.sc

@ -169,8 +169,8 @@ SECTIONS
EOF
. $srcdir/scripttempl/misc-sections.sc
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}

4
ld/scripttempl/elf32msp430.sc

@ -332,8 +332,8 @@ SECTIONS
EOF
. $srcdir/scripttempl/misc-sections.sc
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/DWARF.sc
test -n "${RELOCATING}" && cat <<EOF
.MSP430.attributes 0 :

2
ld/scripttempl/elf64bpf.sc

@ -679,7 +679,7 @@ EOF
test -z "${NON_ALLOC_DYN}" || emit_dyn
. $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/misc-sections.sc
cat <<EOF
${ATTRS_SECTIONS}

4
ld/scripttempl/elf64hppa.sc

@ -533,8 +533,8 @@ if test -n "${NON_ALLOC_DYN}"; then
rm -f ldscripts/dyntmp.$$
fi
. $srcdir/scripttempl/misc-sections.sc
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
${ATTRS_SECTIONS}

4
ld/scripttempl/elf_chaos.sc

@ -327,8 +327,8 @@ cat <<EOF
EOF
. $srcdir/scripttempl/misc-sections.sc
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
${ATTRS_SECTIONS}

4
ld/scripttempl/elfarc.sc

@ -409,8 +409,8 @@ test -n "${RELOCATING}" && cat <<EOF
}
EOF
. $srcdir/scripttempl/misc-sections.sc
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
/* ARC Extension Sections */

4
ld/scripttempl/elfarcv2.sc

@ -294,8 +294,8 @@ SECTIONS
.note.gnu.build-id : { *(.note.gnu.build-id) }
EOF
. $srcdir/scripttempl/misc-sections.sc
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
/* ARC Extension Sections */

4
ld/scripttempl/elfd10v.sc

@ -174,8 +174,8 @@ SECTIONS
EOF
. $srcdir/scripttempl/misc-sections.sc
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}

4
ld/scripttempl/elfd30v.sc

@ -199,8 +199,8 @@ SECTIONS
EOF
. $srcdir/scripttempl/misc-sections.sc
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
${RELOCATING+PROVIDE (__stack = ${STACK_START_ADDR});}

4
ld/scripttempl/elfm68hc11.sc

@ -430,8 +430,8 @@ SECTIONS
EOF
. $srcdir/scripttempl/misc-sections.sc
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}

4
ld/scripttempl/elfm68hc12.sc

@ -432,7 +432,7 @@ SECTIONS
${RELOCATING+${VECTORS}}
EOF
. $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/misc-sections.sc
cat <<EOF
/* Treatment of DWARF debug section must be at end of the linker
@ -441,7 +441,7 @@ cat <<EOF
symbols are found. */
EOF
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}

4
ld/scripttempl/elfm9s12z.sc

@ -422,7 +422,7 @@ SECTIONS
${RELOCATING+${VECTORS}}
EOF
. $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/misc-sections.sc
cat <<EOF
/* Treatment of DWARF debug section must be at end of the linker
@ -431,7 +431,7 @@ cat <<EOF
symbols are found. */
EOF
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}

4
ld/scripttempl/elfmicroblaze.sc

@ -234,8 +234,8 @@ SECTIONS
}
EOF
. $srcdir/scripttempl/misc-sections.sc
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}

4
ld/scripttempl/elfxgate.sc

@ -432,8 +432,8 @@ SECTIONS
${RELOCATING+${VECTORS}}
EOF
. $srcdir/scripttempl/misc-sections.sc
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}

5
ld/scripttempl/elfxtensa.sc

@ -543,9 +543,8 @@ if test -n "${NON_ALLOC_DYN}"; then
rm -f ldscripts/dyntmp.$$
fi
. $srcdir/scripttempl/misc-sections.sc
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
${ATTRS_SECTIONS}

5
ld/scripttempl/epiphany_4x4.sc

@ -626,9 +626,8 @@ if test -n "${NON_ALLOC_DYN}"; then
rm -f ldscripts/dyntmp.$$
fi
. $srcdir/scripttempl/misc-sections.sc
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
${ATTRS_SECTIONS}

13
ld/scripttempl/ft32.sc

@ -60,14 +60,11 @@ SECTIONS
${RELOCATING+ __data_load_start = LOADADDR(.data); }
${RELOCATING+ __data_load_end = __data_load_start + SIZEOF(.data); }
EOF
.stab 0 ${RELOCATING+(NOLOAD)} :
{
*(.stab)
}
.stabstr 0 ${RELOCATING+(NOLOAD)} :
{
*(.stabstr)
}
source_sh $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}
EOF

2
ld/scripttempl/i386beos.sc

@ -174,7 +174,7 @@ SECTIONS
}
EOF
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}

2
ld/scripttempl/i386go32.sc

@ -91,7 +91,7 @@ SECTIONS
.stabstr 0 : { *(.stabstr) }
EOF
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}

2
ld/scripttempl/ia64vms.sc

@ -122,7 +122,7 @@ SECTIONS
EOF
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
.note : { *(.vms.note) }

5
ld/scripttempl/ip2k.sc

@ -137,9 +137,8 @@ SECTIONS
EOF
. $srcdir/scripttempl/misc-sections.sc
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}

5
ld/scripttempl/iq2000.sc

@ -408,9 +408,8 @@ cat <<EOF
EOF
. $srcdir/scripttempl/misc-sections.sc
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
${RELOCATING+${OTHER_RELOCATING_SECTIONS}}

5
ld/scripttempl/mep.sc

@ -408,9 +408,8 @@ cat <<EOF
EOF
. $srcdir/scripttempl/misc-sections.sc
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
${STACK_ADDR+${STACK}}

2
ld/scripttempl/misc-sections.sc

@ -13,7 +13,7 @@ cat <<EOF
.stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) }
.comment : { *(.comment); LINKER_VERSION; }
.comment 0 (INFO) : { *(.comment); LINKER_VERSION; }
.gnu.build.attributes : { *(.gnu.build.attributes${RELOCATING+ .gnu.build.attributes.*}) }

2
ld/scripttempl/mmo.sc

@ -128,7 +128,7 @@ SECTIONS
.stab.indexstr 0 : { *(.stab.indexstr) }
EOF
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
.MMIX.reg_contents :

5
ld/scripttempl/nds32elf.sc

@ -601,9 +601,8 @@ EOF
test -z "${NON_ALLOC_DYN}" || emit_dyn
. $srcdir/scripttempl/misc-sections.sc
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
${ATTRS_SECTIONS}

5
ld/scripttempl/pru.sc

@ -204,9 +204,8 @@ SECTIONS
.note.gnu.build-id ${RELOCATING-0} : { *(.note.gnu.build-id) }
EOF
. $srcdir/scripttempl/misc-sections.sc
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}

5
ld/scripttempl/v850.sc

@ -198,9 +198,8 @@ SECTIONS
EOF
. $srcdir/scripttempl/misc-sections.sc
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
/* User stack. */

5
ld/scripttempl/v850_rh850.sc

@ -218,9 +218,8 @@ SECTIONS
EOF
. $srcdir/scripttempl/misc-sections.sc
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
/* User stack. */

2
ld/scripttempl/visium.sc

@ -167,7 +167,7 @@ SECTIONS
EOF
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}

5
ld/scripttempl/xstormy16.sc

@ -205,9 +205,8 @@ SECTIONS
EOF
. $srcdir/scripttempl/misc-sections.sc
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
${RELOCATING+${OTHER_RELOCATING_SECTIONS}}

4
ld/scripttempl/z80.sc

@ -51,8 +51,8 @@ SECTIONS
}
EOF
. $srcdir/scripttempl/misc-sections.sc
. $srcdir/scripttempl/DWARF.sc
source_sh $srcdir/scripttempl/misc-sections.sc
source_sh $srcdir/scripttempl/DWARF.sc
cat <<EOF
}

1
ld/testsuite/ld-scripts/ld-version-2.d

@ -2,7 +2,6 @@
# ld: --enable-linker-version -e 0
# readelf: -p.comment
# target: [is_elf_format]
# skip: ft32-*-* pru-*-*
String dump of section '.comment':
.*GNU ld \(GNU Binutils\) 2.*

Loading…
Cancel
Save