aboutsummaryrefslogtreecommitdiff
path: root/ld/scripttempl
AgeCommit message (Collapse)AuthorFilesLines
2018-04-11Remove i860, i960, bout and aout-adobe targetsAlan Modra2-91/+0
Plus remove a few leftovers from the 29k support. include/ * aout/adobe.h: Delete. * aout/reloc.h: Delete. * coff/i860.h: Delete. * coff/i960.h: Delete. * elf/i860.h: Delete. * elf/i960.h: Delete. * opcode/i860.h: Delete. * opcode/i960.h: Delete. * aout/aout64.h (enum reloc_type): Trim off 29k and other unused values. * aout/ar.h (ARMAGB): Remove. * coff/internal.h (struct internal_aouthdr, struct internal_scnhdr, union internal_auxent): Remove i960 support. bfd/ * aout-adobe.c: Delete. * bout.c: Delete. * coff-i860.c: Delete. * coff-i960.c: Delete. * cpu-i860.c: Delete. * cpu-i960.c: Delete. * elf32-i860.c: Delete. * elf32-i960.c: Delete. * hosts/i860mach3.h: Delete. * Makefile.am: Remove i860, i960, bout, and adobe support. * archures.c: Remove i860 and i960 support. * coffcode.h: Likewise. * reloc.c: Likewise. * aoutx.h: Comment updates. * archive.c: Remove BOUT and i960 support. * bfd.c: Remove BOUT support. * coffswap.h: Remove i960 support. * config.bfd: Remove i860, i960 and adobe targets. * configure.ac: Remove adode, bout, i860, i960, icoff targets. * targets.c: Likewise. * ieee.c: Remove i960 support. * mach-o.c: Remove i860 support. * Makefile.in: Regenerate. * bfd-in2.h: Regenerate. * configure: Regenerate. * libbfd.h: Regenerate. * po/SRC-POTFILES.in: Regenerate. opcodes/ * opcodes/i860-dis.c: Delete. * opcodes/i960-dis.c: Delete. * Makefile.am: Remove i860 and i960 support. * configure.ac: Likewise. * disassemble.c: Likewise. * disassemble.h: Likewise. * Makefile.in: Regenerate. * configure: Regenerate. * po/POTFILES.in: Regenerate. binutils/ * ieee.c: Remove i960 support. * od-macho.c: Remove i860 support. * readelf.c: Remove i860 and i960 support. * testsuite/binutils-all/objcopy.exp: Likewise. * testsuite/binutils-all/objdump.exp: Likewise. * testsuite/lib/binutils-common.exp: Likewise. gas/ * config/aout_gnu.h: Delete. * config/tc-i860.c: Delete. * config/tc-i860.h: Delete. * config/tc-i960.c: Delete. * config/tc-i960.h: Delete. * doc/c-i860.texi: Delete. * doc/c-i960.texi: Delete. * testsuite/gas/i860/README.i860: Delete. * testsuite/gas/i860/bitwise.d: Delete. * testsuite/gas/i860/bitwise.s: Delete. * testsuite/gas/i860/branch.d: Delete. * testsuite/gas/i860/branch.s: Delete. * testsuite/gas/i860/bte.d: Delete. * testsuite/gas/i860/bte.s: Delete. * testsuite/gas/i860/dir-align01.d: Delete. * testsuite/gas/i860/dir-align01.s: Delete. * testsuite/gas/i860/dir-intel01.d: Delete. * testsuite/gas/i860/dir-intel01.s: Delete. * testsuite/gas/i860/dir-intel02.d: Delete. * testsuite/gas/i860/dir-intel02.s: Delete. * testsuite/gas/i860/dir-intel03-err.l: Delete. * testsuite/gas/i860/dir-intel03-err.s: Delete. * testsuite/gas/i860/dual01.d: Delete. * testsuite/gas/i860/dual01.s: Delete. * testsuite/gas/i860/dual02-err.l: Delete. * testsuite/gas/i860/dual02-err.s: Delete. * testsuite/gas/i860/dual03.d: Delete. * testsuite/gas/i860/dual03.s: Delete. * testsuite/gas/i860/fldst01.d: Delete. * testsuite/gas/i860/fldst01.s: Delete. * testsuite/gas/i860/fldst02.d: Delete. * testsuite/gas/i860/fldst02.s: Delete. * testsuite/gas/i860/fldst03.d: Delete. * testsuite/gas/i860/fldst03.s: Delete. * testsuite/gas/i860/fldst04.d: Delete. * testsuite/gas/i860/fldst04.s: Delete. * testsuite/gas/i860/fldst05.d: Delete. * testsuite/gas/i860/fldst05.s: Delete. * testsuite/gas/i860/fldst06.d: Delete. * testsuite/gas/i860/fldst06.s: Delete. * testsuite/gas/i860/fldst07.d: Delete. * testsuite/gas/i860/fldst07.s: Delete. * testsuite/gas/i860/fldst08.d: Delete. * testsuite/gas/i860/fldst08.s: Delete. * testsuite/gas/i860/float01.d: Delete. * testsuite/gas/i860/float01.s: Delete. * testsuite/gas/i860/float02.d: Delete. * testsuite/gas/i860/float02.s: Delete. * testsuite/gas/i860/float03.d: Delete. * testsuite/gas/i860/float03.s: Delete. * testsuite/gas/i860/float04.d: Delete. * testsuite/gas/i860/float04.s: Delete. * testsuite/gas/i860/form.d: Delete. * testsuite/gas/i860/form.s: Delete. * testsuite/gas/i860/i860.exp: Delete. * testsuite/gas/i860/iarith.d: Delete. * testsuite/gas/i860/iarith.s: Delete. * testsuite/gas/i860/ldst01.d: Delete. * testsuite/gas/i860/ldst01.s: Delete. * testsuite/gas/i860/ldst02.d: Delete. * testsuite/gas/i860/ldst02.s: Delete. * testsuite/gas/i860/ldst03.d: Delete. * testsuite/gas/i860/ldst03.s: Delete. * testsuite/gas/i860/ldst04.d: Delete. * testsuite/gas/i860/ldst04.s: Delete. * testsuite/gas/i860/ldst05.d: Delete. * testsuite/gas/i860/ldst05.s: Delete. * testsuite/gas/i860/ldst06.d: Delete. * testsuite/gas/i860/ldst06.s: Delete. * testsuite/gas/i860/pfam.d: Delete. * testsuite/gas/i860/pfam.s: Delete. * testsuite/gas/i860/pfmam.d: Delete. * testsuite/gas/i860/pfmam.s: Delete. * testsuite/gas/i860/pfmsm.d: Delete. * testsuite/gas/i860/pfmsm.s: Delete. * testsuite/gas/i860/pfsm.d: Delete. * testsuite/gas/i860/pfsm.s: Delete. * testsuite/gas/i860/pseudo-ops01.d: Delete. * testsuite/gas/i860/pseudo-ops01.s: Delete. * testsuite/gas/i860/regress01.d: Delete. * testsuite/gas/i860/regress01.s: Delete. * testsuite/gas/i860/shift.d: Delete. * testsuite/gas/i860/shift.s: Delete. * testsuite/gas/i860/simd.d: Delete. * testsuite/gas/i860/simd.s: Delete. * testsuite/gas/i860/system.d: Delete. * testsuite/gas/i860/system.s: Delete. * testsuite/gas/i860/xp.d: Delete. * testsuite/gas/i860/xp.s: Delete. * Makefile.am: Remove i860 and i960 support. * configure.tgt: Likewise. * doc/Makefile.am: Likewise. * doc/all.texi: Likewise. * testsuite/gas/all/gas.exp * config/obj-coff.h: Remove i960 support. * doc/internals.texi: Likewise. * expr.c: Likewise. * read.c: Likewise. * write.c: Likewise. * write.h: Likewise. * testsuite/gas/lns/lns.exp: Likewise. * testsuite/gas/symver/symver.exp: Likewise. * config/tc-m68k.c: Remove BOUT support. * config/tc-score.c: Likewise. * config/tc-score7.c: Likewise. * config/tc-sparc.c: Likewise. * symbols.c: Likewise. * doc/h8.texi: Likewise. * configure.ac: Remove BOUT and i860 support. * doc/as.texinfo: Remove BOUT, i860 and i960 support * Makefile.in: Regenerate. * config.in: Regenerate. * configure: Regenerate. * doc/Makefile.in: Regenerate. * po/POTFILES.in: Regenerate. ld/ * emulparams/coff_i860.sh: Delete. * emulparams/elf32_i860.sh: Delete. * emulparams/elf32_i960.sh: Delete. * emulparams/gld960.sh: Delete. * emulparams/gld960coff.sh: Delete. * emulparams/lnk960.sh: Delete. * emultempl/gld960.em: Delete. * emultempl/gld960c.em: Delete. * emultempl/lnk960.em: Delete. * scripttempl/i860coff.sc: Delete. * scripttempl/i960.sc: Delete. * ld.texinfo: Remove i960 support. * Makefile.am: Remove i860 and i960 support. * configure.tgt: Likewise. * testsuite/ld-discard/extern.d: Likewise. * testsuite/ld-discard/start.d: Likewise. * testsuite/ld-discard/static.d: Likewise. * testsuite/ld-elf/compressed1d.d: Likewise. * testsuite/ld-elf/group1.d: Likewise. * testsuite/ld-elf/group3b.d: Likewise. * testsuite/ld-elf/group8a.d: Likewise. * testsuite/ld-elf/group8b.d: Likewise. * testsuite/ld-elf/group9a.d: Likewise. * testsuite/ld-elf/group9b.d: Likewise. * testsuite/ld-elf/linkonce2.d: Likewise. * testsuite/ld-elf/merge.d: Likewise. * testsuite/ld-elf/merge2.d: Likewise. * testsuite/ld-elf/merge3.d: Likewise. * testsuite/ld-elf/orphan-10.d: Likewise. * testsuite/ld-elf/orphan-11.d: Likewise. * testsuite/ld-elf/orphan-12.d: Likewise. * testsuite/ld-elf/orphan-9.d: Likewise. * testsuite/ld-elf/orphan-region.d: Likewise. * testsuite/ld-elf/orphan.d: Likewise. * testsuite/ld-elf/orphan3.d: Likewise. * testsuite/ld-elf/pr12851.d: Likewise. * testsuite/ld-elf/pr12975.d: Likewise. * testsuite/ld-elf/pr13177.d: Likewise. * testsuite/ld-elf/pr13195.d: Likewise. * testsuite/ld-elf/pr17550a.d: Likewise. * testsuite/ld-elf/pr17550b.d: Likewise. * testsuite/ld-elf/pr17550c.d: Likewise. * testsuite/ld-elf/pr17550d.d: Likewise. * testsuite/ld-elf/pr17615.d: Likewise. * testsuite/ld-elf/pr20528a.d: Likewise. * testsuite/ld-elf/pr20528b.d: Likewise. * testsuite/ld-elf/pr21562a.d: Likewise. * testsuite/ld-elf/pr21562b.d: Likewise. * testsuite/ld-elf/pr21562c.d: Likewise. * testsuite/ld-elf/pr21562d.d: Likewise. * testsuite/ld-elf/pr21562i.d: Likewise. * testsuite/ld-elf/pr21562j.d: Likewise. * testsuite/ld-elf/pr21562k.d: Likewise. * testsuite/ld-elf/pr21562l.d: Likewise. * testsuite/ld-elf/pr21562m.d: Likewise. * testsuite/ld-elf/pr21562n.d: Likewise. * testsuite/ld-elf/pr22677.d: Likewise. * testsuite/ld-elf/pr22836-1a.d: Likewise. * testsuite/ld-elf/pr22836-1b.d: Likewise. * testsuite/ld-elf/pr349.d: Likewise. * testsuite/ld-elf/sec-to-seg.exp: Likewise. * testsuite/ld-elf/sec64k.exp: Likewise. * testsuite/ld-elf/warn1.d: Likewise. * testsuite/ld-elf/warn2.d: Likewise. * testsuite/ld-elf/warn3.d: Likewise. * testsuite/lib/ld-lib.exp: Likewise. * Makefile.in: Regenerate. * po/BLD-POTFILES.in: Regenerate.
2018-02-03Remove PROVIDE() qualifiers from definition of __CTOR_LIST__ and ↵Nick Clifton2-8/+40
__DTOR_LIST__ symbols in PE linker scripts. PR 22762 * scripttempl/pe.sc: Remove PROVIDE()s from __CTOR_LIST__ and __DTOR_LIST__ symbols. Add a comment explaining why this is necessary. * scripttemp/pep.sc: Likewise. * ld.texinfo (PROVIDE): Add a note about the effect of common symbols.
2018-01-11ld: Add "-z separate-code" option to ELF linkerH.J. Lu1-3/+19
The new "-z separate-code" option will generate separate code LOAD segment which must be in wholly disjoint pages from any other data. include/ PR ld/22393 * bfdlink.h (bfd_link_info): Add separate_code. ld/ PR ld/22393 * NEWS: Mention "-z separate-code". * emultempl/elf32.em (gld${EMULATION_NAME}_get_script): Get builtin linker scripts and return linker scripts from disk for "-z separate-code". (gld${EMULATION_NAME}_handle_option): Handle "-z separate-code" and "-z noseparate-code". * genscripts.sh: Generate linker scripts for "-z separate-code". (LD_FLAG): Set to *textonly for "-z separate-code". * ld.texinfo: Document "-z separate-code". * lexsup.c (elf_shlib_list_options): Add linker help messsages for "-z separate-code" and "-z noseparate-code". * scripttempl/elf.sc (SEPARATE_TEXT): New (TEXT_SEGMENT_ALIGN): Likewise. Use ${TEXT_SEGMENT_ALIGN} to align and pad text segment to ${MAXPAGESIZE}.
2018-01-11ld: Keep PREINIT_ARRAY/INIT_ARRAY/FINI_ARRAY sections for -r --gc-sectionsH.J. Lu1-6/+7
We must keep all PREINIT_ARRAY, INIT_ARRAY as well as FINI_ARRAY sections for ld -r --gc-sections. bfd/ PR ld/22677 * elflink.c (bfd_elf_gc_sections): Keep all PREINIT_ARRAY, INIT_ARRAY as well as FINI_ARRAY sections for ld -r --gc-sections. ld/ PR ld/22677 * scripttempl/elf.sc (PREINIT_ARRAY): New. Don't add .preinit_array for ld -r. * testsuite/ld-elf/pr22677.d: New file. * testsuite/ld-elf/pr22677.s: Likewise.
2018-01-11Fix the order of SHLIB_RODATA_ADDR in elf.scH.J. Lu1-1/+1
elf.sc has if test -n "${RODATA_ADDR}"; then RODATA_ADDR="\ SEGMENT_START(\"rodata-segment\", ${RODATA_ADDR}) + SIZEOF_HEADERS" else RODATA_ADDR="ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))" ^^^^^^^^^^ Set RODATA_ADDR RODATA_ADDR="SEGMENT_START(\"rodata-segment\", ${RODATA_ADDR})" ^^^^^^^^^^ Set RODATA_ADDR with ${RODATA_ADDR} fi if test -n "${SHLIB_RODATA_ADDR}"; then SHLIB_RODATA_ADDR="\ SEGMENT_START(\"rodata-segment\", ${SHLIB_RODATA_ADDR}) + SIZEOF_HEADERS" else SHLIB_RODATA_ADDR="SEGMENT_START(\"rodata-segment\", ${SHLIB_RODATA_ADDR})" ^^^^^^^^^^ Set SHLIB_RODATA_ADDR SHLIB_RODATA_ADDR="ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))" ^^^^^^^^^^ Override SHLIB_RODATA_ADDR fi The order should be: if test -n "${SHLIB_RODATA_ADDR}"; then SHLIB_RODATA_ADDR="\ SEGMENT_START(\"rodata-segment\", ${SHLIB_RODATA_ADDR}) + SIZEOF_HEADERS" else SHLIB_RODATA_ADDR="ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))" SHLIB_RODATA_ADDR="SEGMENT_START(\"rodata-segment\", ${SHLIB_RODATA_ADDR})" fi PR ld/22696 * scripttempl/elf.sc: Fix the order of SHLIB_RODATA_ADDR.
2018-01-03Update year range in copyright notice of binutils filesAlan Modra91-178/+178
2017-11-12ld: Add OTHER_PLT_SECTIONSH.J. Lu1-2/+3
OTHER_PLT_SECTIONS contains sections which should be placed right after .plt section. * emulparams/elf32_x86_64.sh (TINY_READONLY_SECTION): Renamed to ... (OTHER_PLT_SECTIONS): This. * emulparams/elf_i386.sh: Likewise. * emulparams/elf_iamcu.sh: Likewise. * emulparams/elf_x86_64.sh: Likewise. * scripttempl/elf.sc: Place ${OTHER_PLT_SECTIONS} just after .plt.
2017-10-12ld whitespace fixesAlan Modra92-645/+642
* pe-dll.c: Formatting, whitespace fixes. * NEWS: Whitespace fixes. * configure.ac: Likewise. * configure.tgt: Likewise. * deffilep.y: Likewise. * genscripts.sh: Likewise. * ld.texinfo: Likewise. * ldgram.y: Likewise. * ldlang.c: Likewise. * ldlex.l: Likewise. * lexsup.c: Likewise. * plugin.c: Likewise. * emulparams/arc-endianness.sh: Likewise. * emulparams/elf32_x86_64.sh: Likewise. * emulparams/elf64mmix.sh: Likewise. * emulparams/elf_x86_64.sh: Likewise. * emulparams/h8300elf.sh: Likewise. * emulparams/h8300elf_linux.sh: Likewise. * emulparams/vxworks.sh: Likewise. * emultempl/aarch64elf.em: Likewise. * emultempl/aix.em: Likewise. * emultempl/armelf.em: Likewise. * emultempl/avrelf.em: Likewise. * emultempl/beos.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/m68kcoff.em: Likewise. * emultempl/m68kelf.em: Likewise. * emultempl/metagelf.em: Likewise. * emultempl/msp430.em: Likewise. * emultempl/nds32elf.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/sh64elf.em: Likewise. * emultempl/spu_ovl.S: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/tic6xdsbt.em: Likewise. * emultempl/ticoff.em: Likewise. * emultempl/vms.em: Likewise. * po/Make-in: Likewise. * scripttempl/DWARF.sc: Likewise. * scripttempl/aix.sc: Likewise. * scripttempl/alpha.sc: Likewise. * scripttempl/alphavms.sc: Likewise. * scripttempl/aout.sc: Likewise. * scripttempl/arclinux.sc: Likewise. * scripttempl/armaout.sc: Likewise. * scripttempl/armbpabi.sc: Likewise. * scripttempl/armcoff.sc: Likewise. * scripttempl/avr.sc: Likewise. * scripttempl/crisaout.sc: Likewise. * scripttempl/delta68.sc: Likewise. * scripttempl/dlx.sc: Likewise. * scripttempl/elf.sc: Likewise. * scripttempl/elf32cr16.sc: Likewise. * scripttempl/elf32cr16c.sc: Likewise. * scripttempl/elf32crx.sc: Likewise. * scripttempl/elf32msp430.sc: Likewise. * scripttempl/elf32msp430_3.sc: Likewise. * scripttempl/elf32sh-symbian.sc: Likewise. * scripttempl/elf32xc16x.sc: Likewise. * scripttempl/elf32xc16xl.sc: Likewise. * scripttempl/elf32xc16xs.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/elfi370.sc: Likewise. * scripttempl/elfm68hc11.sc: Likewise. * scripttempl/elfm68hc12.sc: Likewise. * scripttempl/elfmicroblaze.sc: Likewise. * scripttempl/elfxgate.sc: Likewise. * scripttempl/elfxtensa.sc: Likewise. * scripttempl/epiphany_4x4.sc: Likewise. * scripttempl/epocpe.sc: Likewise. * scripttempl/h8300.sc: Likewise. * scripttempl/h8300h.sc: Likewise. * scripttempl/h8300hn.sc: Likewise. * scripttempl/h8300s.sc: Likewise. * scripttempl/h8300sn.sc: Likewise. * scripttempl/h8300sx.sc: Likewise. * scripttempl/h8300sxn.sc: Likewise. * scripttempl/h8500.sc: Likewise. * scripttempl/h8500b.sc: Likewise. * scripttempl/h8500c.sc: Likewise. * scripttempl/h8500m.sc: Likewise. * scripttempl/h8500s.sc: Likewise. * scripttempl/hppaelf.sc: Likewise. * scripttempl/i386beos.sc: Likewise. * scripttempl/i386coff.sc: Likewise. * scripttempl/i386go32.sc: Likewise. * scripttempl/i386msdos.sc: Likewise. * scripttempl/i860coff.sc: Likewise. * scripttempl/i960.sc: Likewise. * scripttempl/ia64vms.sc: Likewise. * scripttempl/ip2k.sc: Likewise. * scripttempl/iq2000.sc: Likewise. * scripttempl/m68kaux.sc: Likewise. * scripttempl/m68kcoff.sc: Likewise. * scripttempl/m88kbcs.sc: Likewise. * scripttempl/mcorepe.sc: Likewise. * scripttempl/mep.sc: Likewise. * scripttempl/mips.sc: Likewise. * scripttempl/mipsbsd.sc: Likewise. * scripttempl/mmo.sc: Likewise. * scripttempl/moxie.sc: Likewise. * scripttempl/nds32elf.sc: Likewise. * scripttempl/nw.sc: Likewise. * scripttempl/pe.sc: Likewise. * scripttempl/pep.sc: Likewise. * scripttempl/pj.sc: Likewise. * scripttempl/ppcpe.sc: Likewise. * scripttempl/psos.sc: Likewise. * scripttempl/riscix.sc: Likewise. * scripttempl/sh.sc: Likewise. * scripttempl/sparccoff.sc: Likewise. * scripttempl/st2000.sc: Likewise. * scripttempl/tic30aout.sc: Likewise. * scripttempl/tic30coff.sc: Likewise. * scripttempl/tic4xcoff.sc: Likewise. * scripttempl/tic54xcoff.sc: Likewise. * scripttempl/tic80coff.sc: Likewise. * scripttempl/v850.sc: Likewise. * scripttempl/v850_rh850.sc: Likewise. * scripttempl/vanilla.sc: Likewise. * scripttempl/visium.sc: Likewise. * scripttempl/w65.sc: Likewise. * scripttempl/xstormy16.sc: Likewise. * scripttempl/z80.sc: Likewise. * scripttempl/z8000.sc: Likewise. * configure: Regenerate.
2017-08-10Add support for PE startup files that want to define their own constructor ↵Nick Clifton2-16/+36
and desctructor sequencing. * scripttempl/pep.sc: Enclose __CTOR_LIST__, ___CTOR_LIST__, __DTOR_LIST__ and ___DTOR_LIST__ in PROVIDE statements so that they can be overrridden by crt input files. * scripttempl/pe.sc: Likewise.
2017-07-27Move AVR .promemx.* sections into higher memory.Georg-Johann Lay1-1/+3
PR ld/21849 * scripttempl/avr.sc: Split .progmemx.* from .progmem.* and locate former at a higher address.
2017-07-19[ARC] Add JLI support.John Eric Martin2-0/+11
The following relocation types were added to GCC/binutils: ARC_JLI_SECTOFF is a relocation type in Metaware that is now used by GCC as well to adjust the index of function calls to functions with attribute jli_call_always. bfd/ 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com> John Eric Martin <John.Martin@emmicro-us.com> * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * elf32-arc.c (JLI): Define. * reloc.c: Add JLI relocations. gas/ 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com> * testsuite/gas/arc/jli-1.d: New file. * testsuite/gas/arc/jli-1.s: Likewise. * testsuite/gas/arc/taux.d: Update for jli_base. include/ 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com> John Eric Martin <John.Martin@emmicro-us.com> * elf/arc-reloc.def: Add JLI relocs howto. * opcode/arc-func.h (replace_jli): New function. ld/ 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com> John Eric Martin <John.Martin@emmicro-us.com> * emulparams/arcelf.sh (JLI_START_TABLE): Define. * scripttempl/elfarc.sc: Handle jlitab section. * scripttempl/elfarcv2.sc: Likewise. * testsuite/ld-arc/arc.exp: Add JLI test. * testsuite/ld-arc/jli-script.ld: New file. * testsuite/ld-arc/jli-simple.dd: Likewise. * testsuite/ld-arc/jli-simple.rd: Likewise. * testsuite/ld-arc/jli-simple.s: Likewise. * testsuite/ld/testsuite/ld-arc/jli-overflow.s: Likewise. * testsuite/ld/testsuite/ld-arc/jli-overflow.d: Likewise. * testsuite/ld/testsuite/ld-arc/jli-overflow.err: Likewise. opcode/ 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com> John Eric Martin <John.Martin@emmicro-us.com> * arc-opc.c (UIMM10_6_S_JLIOFF): Define. (UIMM3_23): Adjust accordingly. * arc-regs.h: Add/correct jli_base register. * arc-tbl.h (jli_s): Likewise.
2017-06-14Move location of .jumptables section and add .hightext section to AVR linker ↵Georg-Johann Lay1-5/+12
script. PR ld/21583 * scripttempl/avr.sc (.jumptables): Move down in text section. (.hightext): New in text.
2017-06-13Replace multiple AVR scripts with a single, customizable linker script.Georg-Johann Lay2-279/+35
PR ld/21569 * scripttempl/avrtiny.sc: Remove file. * Makefile.am (eavrtiny.c): Depend on avr.sc, no more on avrtiny.sc. * Makefile.in: Regenerate. * emulparams/avrtiny.sh (SCRIPT_NAME): Set var to "avr". (TEXT_ORIGIN): Remove var. (FUSE_NAME, FUSE_LENGTH, LOCK_LENGTH, SIGNATURE_LENGTH) (RODATA_PM_OFFSET): Set new vars. * emulparams/avr1.sh (FUSE_NAME, EEPROM_LENGTH, FUSE_LENGTH) (LOCK_LENGTH, SIGNATURE_LENGTH, USER_SIGNATURE_LENGTH): Set new vars. * emulparams/avr2.sh: Same. * emulparams/avr25.sh: Same. * emulparams/avr3.sh: Same. * emulparams/avr31.sh: Same. * emulparams/avr35.sh: Same. * emulparams/avr4.sh: Same. * emulparams/avr5.sh: Same. * emulparams/avr51.sh: Same. * emulparams/avr6.sh: Same. * emulparams/avrxmega1.sh: Same. * emulparams/avrxmega2.sh: Same. * emulparams/avrxmega3.sh: Same. * emulparams/avrxmega4.sh: Same. * emulparams/avrxmega5.sh: Same. * emulparams/avrxmega6.sh: Same. * emulparams/avrxmega7.sh: Same. * scripttempl/avr.sc (__EEPROM_REGION_LENGTH__): Only define if EEPROM_LENGTH is set. (MEMORY) [eeprom]: Same. (SECTIONS) [.eeprom]: Same for output section. (__USER_SIGNATURE_REGION_LENGTH__): Only define if USER_SIGNATURE_LENGTH is set. (MEMORY) [user_signatures]: Same. (SECTIONS) [.fuse]: Only define output section if FUSE_NAME = fuse. (SECTIONS) [.config]: Only define output section if FUSE_NAME = config.
2017-05-19Update avrxmega3 linker emulation to support avrxmega2 devices with flash ↵eorg-Johann Lay1-1/+50
memory visible in the SRAM address range. PR ld/21472 ld * emulparams/avrxmega3.sh (RODATA_PM_OFFSET): Set to 0x8000. * scripttempl/avr.sc (__RODATA_PM_OFFSET__) [RODATA_PM_OFFSET]: Use RODATA_PM_OFFSET as default if not already defined. (.data) [!RODATA_PM_OFFSET]: Don't include .rodata and friends. (.rodata) [RODATA_PM_OFFSET]: Put at an offset of __RODATA_PM_OFFSET__. gas * config/tc-avr.c (mcu_types): Add entries for: attiny416, attiny417, attiny816, attiny817.
2017-05-15Add .debug_gdb_scripts section to PE linker scripts.Nick Clifton2-0/+20
PR ld/21459 * scripttempl/pe.sc: Add .debug_gdb_scripts section. * scripttempl/pep.sc: Likewise.
2017-02-27Place read-only data in the text section on AVR Tiny targets.Georg-Johann Lay1-2/+8
PR target/20849 * scripttempl/avrtiny.sc (__RODATA_PM_OFFSET__): New define. (.rodata): New section. (.data): Remove .rodata*.
2017-02-21PE ld -r script fixesAlan Modra2-15/+25
PR 15041 * scripttempl/pe.sc: Don't combine sections for ld -r. * scripttempl/pep.sc: Likewise.
2017-02-20Move .stack before debug sectionsAlan Modra9-57/+36
PR 20199 * emulparams/elf32m32c.sh: Define STACK_ADDR and STACK_SENTINEL rather than using OTHER_SECTIONS. * emulparams/elf32mt.sh: Likewise. * emulparams/elf32rx.sh: Likewise. * emulparams/elf32rl78.sh: Likewise. Use OTHER_SYMBOLS to define __rl78_abs__. * emulparams/shelf.sh: Define STACK_ADDR and STACK_SENTINEL rather than using OTHER_SECTIONS. * emulparams/shelf32.sh: Likewise. Use OTHER_SECTIONS for .cranges. * emulparams/shelf64.sh: Unset OTHER_SECTIONS. * emulparams/shelf_nbsd.sh: Unset STACK_ADDR not OTHER_SECTIONS. * emulparams/shelf_uclinux.sh: Likewise. * emulparams/shlsymbian.sh: Unset STACK_ADDR. Use OTHER_SYMBOLS to define _stack, not OTHER_SECTIONS. * scripttempl/elf.sc: Move STACK, TINY_DATA_SECTION, and TINY_BSS_SECTION before debug sections. Add STACK_SENTINEL. * scripttempl/arclinux.sc: Likewise. * scripttempl/elf64hppa.sc: Likewise. * scripttempl/elfxtensa.sc: Likewise. * scripttempl/nds32elf.sc: Likewise. * scripttempl/armbpabi.sc: Move STACK before debug sections. * scripttempl/elf_chaos.sc: Likewise. * scripttempl/elfarc.sc: Delete STACK. * scripttempl/epiphany_4x4.sc: Delete STACK. Move TINY_DATA_SECTION, TINY_BSS_SECTION, and .stack before debug sections.
2017-01-02Support -z relro on hppaAlan Modra1-12/+14
PR ld/21000 * emulparams/hppalinux.sh (DATA_ADDR, SHLIB_DATA_ADDR): Don't define. (DATA_SEGMENT_ALIGN, DATA_SEGMENT_END, DATA_SEGMENT_RELRO_END): Define. * scripttempl/elf.sc: Don't define the above if DATA_SEGMENT_ALIGN is already defined.
2017-01-02Update year range in copyright notice of all files.Alan Modra92-180/+180
2016-12-31PRU LD PortDimitar Dimitrov1-0/+179
* NEWS: Mention new PRU target. * Makefile.am: Add PRU target. * configure.tgt: Ditto. * emulparams/pruelf.sh: New file. * emultempl/pruelf.em: New file. * scripttempl/pru.sc: New file. * Makefile.in: Regenerate. * testsuite/ld-pru/emit-relocs-1.d: New PRU testcase file. * testsuite/ld-pru/emit-relocs-1.ld: Ditto. * testsuite/ld-pru/emit-relocs-1a.s: Ditto. * testsuite/ld-pru/emit-relocs-1b.s * testsuite/ld-pru/ldi32.d: Ditto. * testsuite/ld-pru/ldi32.s: Ditto. * testsuite/ld-pru/ldi32_symbol.s: Ditto. * testsuite/ld-pru/norelax_ldi32-data.d: Ditto. * testsuite/ld-pru/norelax_ldi32-dis.d: Ditto. * testsuite/ld-pru/pcrel_s10.d: Ditto. * testsuite/ld-pru/pcrel_s10.s: Ditto. * testsuite/ld-pru/pcrel_s10_label.s: Ditto. * testsuite/ld-pru/pcrel_u8-illegal.d: Ditto. * testsuite/ld-pru/pcrel_u8-illegal.s: Ditto. * testsuite/ld-pru/pcrel_u8-illegal2.d: Ditto. * testsuite/ld-pru/pcrel_u8-illegal2.s: Ditto. * testsuite/ld-pru/pcrel_u8-illegal3.d: Ditto. * testsuite/ld-pru/pcrel_u8-illegal3.s: Ditto. * testsuite/ld-pru/pcrel_u8.d: Ditto. * testsuite/ld-pru/pcrel_u8.s: Ditto. * testsuite/ld-pru/pcrel_u8_label.s: Ditto. * testsuite/ld-pru/pmem.d: Ditto. * testsuite/ld-pru/pmem.s: Ditto. * testsuite/ld-pru/pmem_symbol.s: Ditto. * testsuite/ld-pru/pru.exp: Ditto. * testsuite/ld-pru/relax_ldi32-data.d: Ditto. * testsuite/ld-pru/relax_ldi32-dis.d: Ditto. * testsuite/ld-pru/relax_ldi32.s: Ditto. * testsuite/ld-pru/relax_ldi32_symbol.s: Ditto. * testsuite/ld-pru/reloc.d: Ditto. * testsuite/ld-pru/reloc.s: Ditto. * testsuite/ld-pru/reloc_symbol.s: Ditto. * testsuite/ld-pru/u16.d: Ditto. * testsuite/ld-pru/u16.s: Ditto. * testsuite/ld-pru/u16_symbol.s: Ditto. PRU does not export __end symbol because it is ambiguous for it. Users are expected to use instead the section markers __text_end, __data_end, __bss_end or __noinit_end. * testsuite/lib/ld-lib.exp (check_shared_lib_support): No shared libraries are supported for PRU. (check_gc_sections_available): Mark PRU as not supported. * testsuite/ld-elf/eh-frame-hdr.d: Disable for PRU. * testsuite/ld-elf/endsym.d: Likewise. * testsuite/ld-elf/group8a.d: Likewise. * testsuite/ld-elf/group8b.d: Likewise. * testsuite/ld-elf/group9a.d: Likewise. * testsuite/ld-elf/group9b.d: Likewise. * testsuite/ld-elf/merge.d: Likewise. * testsuite/ld-elf/pr12851.d: Likewise. * testsuite/ld-elf/pr14926.d: Likewise. * testsuite/ld-elf/sec-to-seg.exp: Likewise. * testsuite/ld-elf/sec64k.exp: Mark sec64k case as too big for PRU. * testsuite/ld-srec/srec.exp (run_srec_test): Add setup for PRU. Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
2016-12-26Correct .dynbss in scriptAlan Modra1-1/+1
The only target that renames .bss is tic6x, turning .bss into .far, and .sbss into .bss. .dynbss is not renamed to .dynfar by BFD. * scripttempl/elf.sc: Don't use $BSS_NAME in .dynbss.
2016-12-13PE linker script improvements.Nick Clifton1-3/+3
PR ld/19254 * scripttempl/pe.sc (.fini): KEEP this section. (.gcc_except_table): Likewise. (.pdata): Also accept .pdata*.
2016-11-27Fix spelling in comments in .sc files (ld)Ambrogino Modigliani4-6/+6
* scripttempl/ia64vms.sc: Fix spelling in comments. * scripttempl/ip2k.sc: Fix spelling in comments. * scripttempl/v850.sc: Fix spelling in comments. * scripttempl/v850_rh850.sc: Fix spelling in comments.
2016-10-14Add separate debug info file sectionAlan Modra1-0/+1
* scripttempl/DWARF.sc: Add .debug_addr.
2016-09-30v850 linker scriptsAlan Modra2-2/+2
This should mean the 2010-10-28 change for ld -r --gc-sections can be reverted. * scripttempl/v850.sc: Don't reference __ctbp, __ep, __gp when not relocating. * scripttempl/v850_rh850.sc: Likewise.
2016-07-06FT32 linker script cleanupjamesbowman1-1/+3
Fix a typo (__PMSIZE was written as __PMSIZE_) and add section alignment for DATA and BSS. ld/ChangeLog: * scripttempl/ft32.sc (__PMSIZE): Correct __PMSIZE_. (DATA): add ALIGN. (BSS): add ALIGN
2016-07-04Allow the flash and ram memory region sizes to be specified in the default ↵Nick Clifton1-4/+7
FT32 linker script. * scripttempl/ft32.sc (__PMSIZE_): If not defined, set to 256K. (__RAMSIZE): If not defined, set to 64K. (MEMORY): Set the flash region size to __PMSIZE and the ram region size to __RAMSIZE.
2016-05-26Provide the __bssstart and __bsssize symbols needed by the MSP430's crt0.o code.Nick Clifton2-1/+5
PR target/20134 * scripttempl/elf32msp430.sc (.bss): Provide __bssstart and __bsssize. * scripttempl/elf32msp430_3.sc (.bss): Likewise.
2016-05-19[ARC] Emulation and default script template changes.Claudiu Zissulescu1-176/+419
2016-05-19 Cupertino Miranda <cmiranda@synopsys.com> * emulparams/arcelf.sh: Changed. * emulparams/arclinux.sh: Likewise. * scripttempl/arclinux.sc: Moved to a more standard implementation similar to elf.sc.
2016-05-18Fix lots of linker testsuite failures for the FT32 target.Nick Clifton2-8/+12
* scripttempl/ft32.sc: Use fixed constants for memory region lengths. Include DWARF debug sections. (.data .bss): Do not assign locations during relocatable links. * testsuite/ld-elf/compressed1d.d: Skip for FT32. * testsuite/ld-elf/sec-to-seg.exp: Likewise. * testsuite/ld-elf/sec64k.exp: Likewise. * testsuite/ld-elf/init-fini-array.d: XFail for FT32. * testsuite/ld-elf/merge.d: Likewise. * testsuite/ld-elf/orphan-region.d: Likewise. * testsuite/ld-elf/orphan.s: Likewise. * testsuite/ld-elf/orphan3.d: Likewise. * testsuite/ld-elf/pr349.d: Likewise. * testsuite/ld-elf/warn2.d: Likewise. * testsuite/lib/ld-lib.exp (check_shared_lib_support): Note that the FT32 does not support shared libraries.
2016-05-17Place progmem data from AVR's libc before other progmem data.Senthil Kumar Selvaraj2-0/+8
* scripttempl/avr.sc (text): Place .progmem.data from avr-libc above .progmem*. * scripttempl/avrtiny.sc (text): Likewise.
2016-04-25AVR: Allow the start address of the .text section to be set by --section-start.Senthil Kumar Selvaraj1-1/+1
* scripttempl/avrtiny.sc (.text): Do not set LMA to zero.
2016-04-07Fix typo in name of MSP430 attribute section.Nick Clifton2-2/+2
2016-03-18Ensure that the .rdata_pseudo_runtime_reloc sections are not discarded by ↵Awson2-2/+2
gabage collection. PR 19531 * scripttempl/pe.sc (.rdata_runtime_pseudo_reloc): Always KEEP this section. * scripttempl/pep.sc (.rdata_runtime_pseudo_reloc): Likewise.
2016-03-10Remove bogus LONG(0) from MSP430 built in linker script.Nick Clifton1-1/+0
ld * scripttempl/elf32msp430.sc (.rodata): Remove spurious LONG(0).
2016-03-09Fix v850 bfd arch info printable namesPedro Alves2-2/+2
Currently, it's not possible to manually set some of the v850 archs in gdb: (gdb) set architecture v850<TAB> v850 (using old gcc ABI) v850-rh850 v850e v850e (using old gcc ABI) v850e1 [...] (gdb) set architecture v850 (using old gcc ABI) Ambiguous item "v850 (using old gcc ABI)". The problem is that "set architecture" is a GDB "enum command", and GDB only considers an enum value to be the string up until the first space. So writing "v850 (using old gcc ABI)" is the same as writing "v850", and then that's not an unambiguous arch printable name prefix. v850 is actually the only arch that has spaces in its printable name. One can conveniently see that with e.g.: (gdb) set max-completions unlimited (gdb) complete set architecture ... Rather than hack GDB into accepting this somehow, make v850 arch printable names more like the printable names of the other archs, and put the abi variant in the "machine" part, after a ':'. We now get: (gdb) set architecture v850<TAB> v850:old-gcc-abi v850:rh850 v850e v850e1 v850e1:old-gcc-abi v850e2 v850e2:old-gcc-abi [...] And now "set architecture v850:old-gcc-abi" works as expected. I ran the binutils/gas/ld testsuites, and found no regressions. I don't have a cross compiler handy, but I ran the gdb tests anyway, which covers at least some snoke testing. I think that the OUTPUT_ARCH in ld/scripttempl/v850.sc may have got broken with the previous 2012 change, since I hacked v850_rh850.sc to output "v850" and ld failed to grok it. I think it only works if the old GCC ABI is the configured v850 default ABI. That's now fixed by changing to use explicit v850:old-gcc-abi. Also, this actually "fixes" an existing GDB test, which isn't likewise expecting spaces in arch names, when GDB is configured for --target=v850: (gdb) FAIL: gdb.xml/tdesc-arch.exp: read valid architectures bfd/ChangeLog: 2016-03-09 Pedro Alves <palves@redhat.com> * cpu-v850.c (N): Append ":old-gcc-abi" instead of " (using old gcc ABI)" to printable name. * cpu-v850_rh850.c (bfd_v850_rh850_arch): Use "v850:rh850" instead of "v850-rh850" as printable name. ld/ChangeLog: 2016-03-09 Pedro Alves <palves@redhat.com> * scripttempl/v850.sc: Use "v850:old-gcc-abi" as OUTPUT_ARCH. * scripttempl/v850_rh850.sc: Use "v850:rh850" as OUTPUT_ARCH.
2016-02-29[ARC] General fixes.Claudiu Zissulescu1-2/+2
bfd/ 2016-02-29 Cupertino Miranda <Cupertino.Miranda@synopsys.com> * elf32-arc.c (arc_elf_final_write_processing): Add condition to the flag change. (elf_arc_relocate_section): Fixes and conditions to support PIE. Assert for code sections dynamic relocs. gas/ 2016-02-29 Claudiu Zissulescu <Claudiu.Zissulescu@synopsys.com> * config/tc-arc.c: Enable code density instructions for ARC EM. ld/ 2016-02-29 Cupertino Miranda <Cupertino.Miranda@synopsys.com> * scripttempl/arclinux.sc: Force .tdata and .tbss to always be generated.
2016-01-25Prevent .noinit section from incorrect placement for AVR.Denis Chertykov2-2/+2
When .data and .bss sections are empty .noinit section is placed at data region's start. This will be incorrect for devices that has different data start address than data region start in linker script. The patch updates .noinit section's VMA to end of .bss section. So, .noinit section will be placed at .data section address (-Tdata=<address>) when .data and .bss sections are empty. ld/ * scripttempl/avr.sc (.noinit): Force .noinit VMA to end of .bss VMA. * scripttempl/avrtiny.sc (.noinit): Likewise.
2016-01-05Fix the execution of the MSP430 simulator testsuite.Nick Clifton2-0/+6
ld * emulparams/msp430elf.sh (RAM_START): Move to 0x500 - above the MSP430 hardware multiply address range. * scripttempl/elf32msp430.sc (__romdatastart): Define. (__romdatacopysize): Define. * scripttempl/elf32msp430_3.sc: Likewise. tests * testutils.inc (__pass): Use the LMA addresses of the _passmsg symbol. (__fail): Likewise.
2016-01-01Copyright update for binutilsAlan Modra91-178/+178
2015-10-07New ARC implementation.Nick Clifton5-5/+1211
bfd * archures.c: Remove support for older ARC. Added support for new ARC cpus (ARC600, ARC601, ARC700, ARCV2). * bfd-in2.h: Likewise. * config.bfd: Likewise. * cpu-arc.c: Likewise. * elf32-arc.c: Totally changed file with a refactored inplementation of the ARC port. * libbfd.h: Added ARC specific relocation types. * reloc.c: Likewise. gas * config/tc-arc.c: Revamped file for ARC support. * config/tc-arc.h: Likewise. * doc/as.texinfo: Add new ARC options. * doc/c-arc.texi: Likewise. ld * configure.tgt: Added target arc-*-elf* and arc*-*-linux-uclibc*. * emulparams/arcebelf_prof.sh: New file * emulparams/arcebelf.sh: Likewise. * emulparams/arceblinux_prof.sh: Likewise. * emulparams/arceblinux.sh: Likewise. * emulparams/arcelf_prof.sh: Likewise. * emulparams/arcelf.sh: Likewise. * emulparams/arclinux_prof.sh: Likewise. * emulparams/arclinux.sh: Likewise. * emulparams/arcv2elfx.sh: Likewise. * emulparams/arcv2elf.sh: Likewise. * emultempl/arclinux.em: Likewise. * scripttempl/arclinux.sc: Likewise. * scripttempl/elfarc.sc: Likewise. * scripttempl/elfarcv2.sc: Likewise * Makefile.am: Add new ARC emulations. * Makefile.in: Regenerate. * NEWS: Mention the new feature. opcodes * arc-dis.c: Revamped file for ARC support * arc-dis.h: Likewise. * arc-ext.c: Likewise. * arc-ext.h: Likewise. * arc-opc.c: Likewise. * arc-fxi.h: New file. * arc-regs.h: Likewise. * arc-tbl.h: Likewise. binutils * readelf.c (get_machine_name): Remove A5 reference. Add ARCompact and ARCv2. (get_machine_flags): Handle EM_ARCV2 and EM_ARCOMPACT. (guess_is_rela): Likewise. (dump_relocations): Likewise. (is_32bit_abs_reloc): Likewise. (is_16bit_abs_reloc): Likewise. (is_none_reloc): Likewise. * NEWS: Mention the new feature. include * dis-asm.h (arc_get_disassembler): Correct declaration. * arc-reloc.def: Macro file with definition of all relocation types. * arc.h: Changed macros for the newly supported ARC cpus. Altered enum defining the supported relocations. * common.h: Changed EM_ARC_A5 definition to EM_ARC_COMPACT. Added macro for EM_ARC_COMPACT2. * arc-func.h: New file. * arc.h: Likewise.
2015-09-09FT32 linker script now parameterized for flash and RAM size.jamesbowman1-2/+5
2015-09-09 James Bowman <james.bowman@ftdichip.com> ld/ * scripttempl/ft32.sc: default linker script RAM and FLASH size symbols
2015-08-06Revert ALIGN changesAlan Modra1-2/+2
Reverts a2c59f28 and e474ab13. Since the unary form of ALIGN only references "dot" implicitly, there isn't really a strong argument for making ALIGN use a relative value when inside an output section. * ldexp.c (align_dot_val): Delete. (fold_unary <ALIGN_K, NEXT>): Revert 2015-07-10 change. (is_align_conditional): Revert 2015-07-20 change. (exp_fold_tree_1): Likewise, but keep expanded comment. * scripttempl/elf.sc (.ldata, .bss): Revert 2015-07-20 change. * ld.texinfo (<ALIGN>): Correct description.
2015-07-20ALIGN change affects cris scriptsAlan Modra1-2/+2
More fallout from a2c59f28. This one could have been fixed by simply using ". = ALIGN (ABSOLUTE (.), 2);" but it's nicer to align the section. * emulparams/criself.sh (INIT_ADDR, FINI_ADDR): Define. (INIT_START, FINI_START): Don't ALIGN. * scriptempl/elf.sc (.init, .fini): Apply INIT_ADDR/FINI_ADDR.
2015-07-20ALIGN change affects standard scriptsAlan Modra1-2/+2
a2c59f28 changed the way the unary ALIGN behaved inside output sections, resulting in cris-elf testsuite regressions. This patch pads out .bss in the same manner as it was prior to the ALIGN change. * scripttempl/elf.sc (.ldata, .bss): Align absolute value of dot. * ldexp.c (is_align_conditional): Handle binary ALIGN. (exp_fold_tree_1): Move code setting SEC_KEEP for assignments to dot inside output sections. Handle absolute expressions.
2015-07-03Add experimental support for --gc-sections with COFF and PE based targets.Kai Tietz2-48/+56
PR ld/11539 bfd * coffcode.h (coff_bfd_gc_sections): Define default to bfd_coff_gc_sections function. * cofflink.c (init_reloc_cookie): Copy and adjust coff related code about gc-sections from elflink.c to here. (fini_reloc_cookie): Likewise. (init_reloc_cookie_rels): Likewise. (fini_reloc_cookie_rels): Likewise. (init_reloc_cookie_for_section): Likewise. (fini_reloc_cookie_for_section): Likewise. (_bfd_coff_gc_mark_hook): Likewise. (_bfd_coff_gc_mark_rsec): Likewise. (_bfd_coff_gc_mark_reloc): Likewise. (_bfd_coff_gc_mark): Likewise. (_bfd_coff_gc_mark_extra_sections): Likewise. (coff_gc_sweep_symbol_info): Likewise. (coff_gc_sweep_symbol): Likewise. (gc_sweep_hook_fn): Likewise. (coff_gc_sweep): Likewise. (bfd_coff_gc_sections): Likewise. (_bfd_coff_gc_keep): Likewise. * libcoff.h (coff_reloc_cookie): New struct. (bfd_coff_gc_sections): New prototype. (coff_gc_mark_hook_fn): New type. ld * scripttempl/pep.sc: Mark .idata*, .CRT*, .tls*, .rsrc*, .init, .ctor*, .dtor*, .fini, .jcr, .eh_frame, .pdata. .xdata, and .gcc_except_table sections as KEEP. * scripttempl/pe.sc: Likewise.
2015-05-28Compact EH SupportCatherine Moore1-3/+5
The specification for the Compact EH format is available at: https://github.com/MentorEmbedded/cxx-abi/blob/master/MIPSCompactEH.pdf 2015-05-28 Catherine Moore <clm@codesourcery.com> Bernd Schmidt <bernds@codesourcery.com> Paul Brook <paul@codesourcery.com> bfd/ * bfd-in2.h: Regenerated. * elf-bfd.h (DWARF2_EH_HDR, COMPACT_EH_HDR): Define. (COMPACT_EH_CANT_UNWIND_OPCODE): Define. (dwarf_eh_frame_hdr_info): Move dwarf-specific fields from eh_frame_hdr_info. (compact_eh_frame_hdr_info): Declare. (eh_frame_hdr_info): Redeclare with union for dwarf-specific fields and compact-eh fields. (elf_backend_data): Add cant_unwind_opcode and compact_eh_encoding. (bfd_elf_section_data): Add eh_frame_entry_field. (elf_section_eh_frame_entry): Define. (bfd_elf_parse_eh_frame_entries): Declare. (_bfd_elf_parse_eh_frame_entry): Declare. (_bfd_elf_end_eh_frame_parsing): Declare. (_bfd_elf_write_section_eh_frame_entry): Declare. (_bfd_elf_eh_frame_entry_present): Declare. (_bfd_elf_section_for_symbol): Declare. * elf-eh-frame.c (bfd_elf_discard_eh_frame_entry): New function. (bfd_elf_record_eh_frame_entry): New function. (_bfd_elf_parse_eh_frame_entry): New function. (_bfd_elf_parse_eh_frame): Update hdr_info field references. (cmp_eh_frame_hdr): New function. (add_eh_frame_hdr_terminator): New function. (_bfd_elf_end_eh_frame_parsing): New function. (find_merged_cie): Update hdr_info field references. (_bfd_elf_discard_section_eh_frame): Likewise. (_bfd_elf_discard_section_eh_frame_hdr): Add Compact EH support. (_bfd_elf_eh_frame_entry_present): New function. (_bfd_elf_maybe_strip_eh_frame_hdr): Add Compact EH support. (_bfd_elf_write_section_eh_frame_entry): New function. (_bfd_elf_write_section_eh_frame): Update hdr_info field references. (_bfd_elf_fixup_eh_frame_hdr): New function. (write_compact_eh_frame_hdr): New function. (write_dwarf_eh_frame_hdr): New function. (_bfd_elf_write_section_eh_frame_hdr): Add Compact EH support. * elflink.c (_bfd_elf_section_for_symbol): New function. (elf_section_ignore_discarded_relocs): Add Compact EH support. (elf_link_input_bfd): Likewise. (bfd_elf_final_link): Likewise. (_bfd_elf_gc_mark): Likewise. (bfd_elf_parse_eh_frame_entries): New function. (bfd_elf_gc_sections): Add Compact EH support. (bfd_elf_discard_info): Likewise. * elfxx-mips.c: Include dwarf2.h. (_bfd_mips_elf_compact_eh_encoding): New function. (_bfd_mips_elf_cant_unwind_opcode): New function. * elfxx-mips.h (_bfd_mips_elf_compact_eh_encoding): Declare. (_bfd_mips_elf_cant_unwind_opcode): Declare. (elf_backend_compact_eh_encoding): Define. (elf_backend_cant_unwind_opcode): Define. * elfxx-target.h (elf_backend_compact_eh_encoding): Provide default. (elf_backend_cant_unwind_opcode): Provide default. (elf_backend_data elfNN_bed): Add elf_backend_compact_eh_encoding and elf_backend_cant_unwind_opcode. * section.c (SEC_INFO_TYPE_EH_FRAME_ENTRY): Add definition. gas/ * config/tc-alpha.c (all_cfi_sections): Declare. (s_alpha_ent): Initialize all_cfi_sections. (alpha_elf_md_end): Invoke cfi_set_sections. * config/tc-mips.c (md_apply_fix): Handle BFD_RELOC_NONE. (s_ehword): Use BFD_RELOC_32_PCREL. (mips_fix_adjustable): Handle BFD_RELOC_32_PCREL. (mips_cfi_reloc_for_encoding): New function. * tc-mips.h (DWARF2_FDE_RELOC_SIZE): Redefine. (DWARF2_FDE_RELOC_ENCODING): Define. (tc_cfi_reloc_for_encoding): Define. (mips_cfi_reloc_for_encoding): Define. (tc_compact_eh_opcode_stop): Define. (tc_compact_eh_opcode_pad): Define. * doc/as.texinfo: Document Compact EH extensions. * doc/internals.texi: Likewise. * dw2gencfi.c (EH_FRAME_LINKONCE): Redefine. (tc_cfi_reloc_for_encoding): Provide default. (compact_eh): Declare. (emit_expr_encoded): New function. (get_debugseg_name): Add Compact EH support. (alloc_debugseg_item): Likewise. (cfi_set_sections): New function. (dot_cfi_fde_data): New function. (dot_cfi_personality_id): New function. (dot_cfi_inline_lsda): New function. (cfi_pseudo_table): Add cfi_fde_data, cfi_personality_id, and cfi_inline_lsda. (dot_cfi_personality): Add Compact EH support. (dot_cfi_lsda): Likewise. (dot_cfi_sections): Likewise. (dot_cfi_startproc): Likewise. (get_cfi_seg): Likewise. (output_compact_unwind_data): New function. (output_cfi_insn): Add Compact EH support. (output_cie): Likewise. (output_fde): Likewise. (cfi_finish): Likewise. (cfi_emit_eh_header): New function. (output_eh_header): New function. * dw2gencfi.h (cfi_set_sections): Declare. (SUPPORT_COMPACT_EH): Define. (MULTIPLE_FRAME_SECTIONS): Define. New enumeration to describe the Compact EH header format. (fde_entry): Add new fields personality_id, eh_header_type, eh_data_size, eh_data, eh_loc and sections. (CFI_EMIT_eh_frame, CFI_EMIT_debug_frame, CFI_EMIT_target, CFI_EMIT_eh_frame_compact): Define. 2015-05-22 Catherine Moore <clm@codesourcery.com> Bernd Schmidt <bernds@codesourcery.com> gas/testsuite/ * gas/mips/mips.exp: Run new tests. * gas/mips/compact-eh-1.s: New file. * gas/mips/compact-eh-2.s: New file. * gas/mips/compact-eh-3.s: New file. * gas/mips/compact-eh-4.s: New file. * gas/mips/compact-eh-5.s: New file. * gas/mips/compact-eh-6.s: New file. * gas/mips/compact-eh-7.s: New file. * gas/mips/compact-eh-eb-1.d: New file. * gas/mips/compact-eh-eb-2.d: New file. * gas/mips/compact-eh-eb-3.d: New file. * gas/mips/compact-eh-eb-4.d: New file. * gas/mips/compact-eh-eb-5.d: New file. * gas/mips/compact-eh-eb-6.d: New file. * gas/mips/compact-eh-eb-7.d: New file. * gas/mips/compact-eh-el-1.d: New file. * gas/mips/compact-eh-el-2.d: New file. * gas/mips/compact-eh-el-3.d: New file. * gas/mips/compact-eh-el-4.d: New file. * gas/mips/compact-eh-el-5.d: New file. * gas/mips/compact-eh-el-6.d: New file. * gas/mips/compact-eh-el-7.d: New file. * gas/mips/compact-eh-err1.l: New file. * gas/mips/compact-eh-err1.s: New file. * gas/mips/compact-eh-err2.l: New file. * gas/mips/compact-eh-err2.s: New file. 2015-05-22 Catherine Moore <clm@codesourcery.com> include/ * bfdlink.h: Rename eh_frame_hdr to eh_frame_hdr_type. 2015-05-22 Catherine Moore <clm@codesourcery.com> Paul Brook <paul@codesourcery.com> ld/ * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Add Compact EH support. * scripttempl/elf.sc: Handle .eh_frame_entry and .gnu_extab sections. 2015-05-22 Catherine Moore <clm@codesourcery.com> ld/testsuite/ * ld-mips-elf/compact-eh.ld: New linker script. * ld-mips-elf/compact-eh1.d: New. * ld-mips-elf/compact-eh1.s: New. * ld-mips-elf/compact-eh1a.s: New. * ld-mips-elf/compact-eh1b.s: New. * ld-mips-elf/compact-eh2.d: New. * ld-mips-elf/compact-eh2.s: New. * ld-mips-elf/compact-eh3.d: New. * ld-mips-elf/compact-eh3.s: New. * ld-mips-elf/compact-eh3a.s: New. * ld-mips-elf/compact-eh4.d: New. * ld-mips-elf/compact-eh5.d: New. * ld-mips-elf/compact-eh6.d: New. * ld-mips-elf/mips-elf.exp: Run new tests.
2015-05-05Add support to the MSP430 linker for the automatic placement of code and ↵Nick Clifton1-1/+19
data into either low or high memory regions. gas * config/tc-msp430.c (MAX_OP_LEN): Increase to 4096. (msp430_make_init_symbols): New function. (msp430_section): Call it. (msp430_frob_section): Likewise. ld * emulparams/msp430elf.sh (TEMPLATE_NAME): Change to msp430. * scripttempl/msp430.sc (.text): Add .lower.text and .either.text. (.data): Add .lower.data and .either.data. (.bss): Add .lower.bss and .either.bss. (.rodata): Add .lower.rodata and .either.rodata. * emultempl/msp430.em: New file. Implements a new orphan placement algorithm that divides sections between lower and upper memory regions. * Makefile.am (emsp430elf.c): Depend upon msp430.em. *emsp430X.c): Likewise. * Makefine.in: Regenerate.
2015-04-01Start of relro segment adjustmentAlan Modra1-1/+5
Adjusting the start of the relro segment in order to make it end exactly on a page boundary runs into difficulties when sections in the relro segment are aligned; Adjusting the start by (next_page - end) sometimes results in more than that adjustment occurring at the end, overrunning the page boundary. So when that occurs we try a new lower start position by masking the adjusted start with the maximum section alignment. However, we didn't consider that this masked start address may in fact be before the initial relro base, which is silly since that can only increase padding at the relro end. I've also moved some calculations closer to where they are used, and comments closer to the relevant statements. * ldlang.c (lang_size_sections): When alignment of sections results in relro base adjustment being too large, don't go lower than the initial value. * ldexp.c (fold_binary <DATA_SEGMENT_RELRO_END>): Comment. * scripttempl/elf.sc (DATA_SEGMENT_ALIGN): Omit SEGMENT_SIZE alignment when SEGMENT_SIZE is the same as MAXPAGESIZE.