3 * Tighten linker script grammar around file name specifiers to prevent the use
4 of SORT_BY_ALIGNMENT and SORT_BY_INIT_PRIORITY on filenames. These would
5 previously be accepted but had no effect.
7 * The EXCLUDE_FILE directive can now be placed within any SORT_* directive
8 within input section lists.
12 * Support for -z shstk in the x86 ELF linker to generate
13 GNU_PROPERTY_X86_FEATURE_1_SHSTK in ELF GNU program properties.
15 * Add support for GNU_PROPERTY_X86_FEATURE_1_SHSTK in ELF GNU program
16 properties in the x86 ELF linker.
18 * Add support for GNU_PROPERTY_X86_FEATURE_1_IBT in ELF GNU program
19 properties in the x86 ELF linker.
21 * Support for -z ibtplt in the x86 ELF linker to generate IBT-enabled
24 * Support for -z ibt in the x86 ELF linker to generate IBT-enabled
25 PLT as well as GNU_PROPERTY_X86_FEATURE_1_IBT in ELF GNU program
28 * Add support for ELF SHF_GNU_MBIND and PT_GNU_MBIND_XXX.
30 * Add support for ELF GNU program properties.
32 * Add support for the Texas Instruments PRU processor.
34 * When configuring for arc*-*-linux* targets the default linker emulation will
35 change if --with-cpu=nps400 is used at configure time.
37 * Improve assignment of LMAs to orphan sections in some edge cases where a
38 mixture of both AT>LMA_REGION and AT(LMA) are used.
40 * Orphan sections placed after an empty section that has an AT(LMA) will now
41 take an load memory address starting from LMA.
43 * Section groups can now be resolved (the group deleted and the group members
44 placed like normal sections) at partial link time either using the new linker
45 option --force-group-allocation or by placing FORCE_GROUP_ALLOCATION into the
50 * The EXCLUDE_FILE linker script construct can now be applied outside of the
51 section list in order for the exclusions to apply over all input sections in
54 * Add support for the RISC-V architecture.
56 * The command line option --no-eh-frame-hdr can now be used in ELF based
57 linkers to disable the automatic generation of .eh_frame_hdr sections.
59 * Add --in-implib=<infile> to the ARM linker to enable specifying a set of
60 Secure Gateway veneers that must exist in the output import library specified
61 by --out-implib=<outfile> and the address they must have. As such,
62 --in-implib is only supported in combination with --cmse-implib.
64 * Extended the --out-implib=<file> option, previously restricted to x86 PE
65 targets, to any ELF based target. This allows the generation of an import
66 library for an ELF executable, which can then be used by another application
67 to link against the executable.
71 * Add a configure option --enable-relro to decide whether -z relro should
72 be enabled in ELF linker by default. Default to yes for all Linux
73 targets except FRV, HPPA, IA64 and MIPS.
75 * Support for -z noreloc-overflow in the x86-64 ELF linker to disable
76 relocation overflow check.
78 * Add -z common/-z nocommon options for ELF targets to control whether to
79 convert common symbols to the STT_COMMON type during a relocatable link.
81 * Support for -z nodynamic-undefined-weak in the x86 ELF linker, which
82 avoids dynamic relocations against undefined weak symbols in executable.
84 * The NOCROSSREFSTO command was added to the linker script language.
86 * Add --no-apply-dynamic-relocs to the AArch64 linker to do not apply link-time
87 values for dynamic relocations.
91 * Add --fix-stm32l4xx-629360 to the ARM linker to enable a link-time
92 workaround for a bug in the bus matrix / memory controller for some of
93 the STM32 Cortex-M4 based products (STM32L4xx)
95 * Add a configure option --enable-compressed-debug-sections={all,ld} to
96 decide whether DWARF debug sections should be compressed by default.
98 * Add support for the ARC EM/HS, and ARC600/700 architectures.
100 * Experimental support for linker garbage collection (--gc-sections)
101 has been enabled for COFF and PE based targets.
103 * New command line option for ELF targets to compress DWARF debug
104 sections, --compress-debug-sections=[none|zlib|zlib-gnu|zlib-gabi].
106 * New command line option, --orphan-handling=[place|warn|error|discard], to
107 adjust how orphan sections are handled. The default is 'place' which gives
108 the current behaviour, 'warn' and 'error' issue a warning or error
109 respectively when orphan sections are found, and 'discard' will discard all
112 * Add support for LLVM plugin.
114 * Add --print-memory-usage option to report memory blocks usage.
116 * Add --require-defined option, it's like --undefined except the new symbol
117 must be defined by the end of the link.
121 * PE binaries now once again contain real timestamps by default. To disable
122 the inclusion of a timestamp in a PE binary, use the --no-insert-timestamp
125 * Replace support for openrisc and or32 with support for or1k.
127 * Add support for the --build-id command line option to COFF based targets.
129 * x86/x86_64 pe-coff now supports the --build-id option.
131 * Add support for the Andes NDS32.
135 * Add LOG2CEIL() builtin function to the linker script language
137 * Add support for the Texas Instruments MSP430X processor.
139 * Add support for Altera Nios II.
141 * Add support for the V850E3V5 architecture.
143 * Add support for the Imagination Technologies Meta processor.
145 * --enable-new-dtags no longer generates old dtags in addition to new dtags.
147 * Remove linker support for MIPS ECOFF targets.
149 * Add ALIGN_WITH_INPUT to the linker script language to force the alignment of
150 an output section to use the maximum alignment of all its input sections.
154 * Enable compressed debug section feature for x86/x86_64 pe-coff.
156 * Add support for the 64-bit ARM architecture: AArch64.
158 * Added SORT_NONE to the linker script language to disable section sorting.
160 * Add a linker-provided symbol when producing ELF output, '__ehdr_start'
161 to point to the ELF file header (and nearby program headers) in the
162 program's memory image.
164 * Add support for S12X processor.
166 * Add support for the VLE extension to the PowerPC architecture.
168 * Add support for the Freescale XGATE architecture.
170 * Add option -f FILE on AIX (for response file).
172 * Add support for the Renesas RL78 architecture.
174 * Add support for the Adapteva EPIPHANY architecture.
178 * --copy-dt-needed-entries is no longer enabled by default. Instead
179 --no-copy-dt-needed-entries is the default.
181 * INPUT_SECTION_FLAGS has been added to the linker script language
182 to allow selection of input sections by section header section flags.
184 * Add support for the Tilera TILEPro and TILE-Gx architectures.
186 * Added SORT_BY_INIT_PRIORITY to the linker script language to permit
187 sorting sections by numerical value of the GCC init_priority attribute
188 encoded in the section name.
192 * Linker script expression evaluation is somewhat more sane. This may
193 break scripts that depend on quirks of the old expression evaluation.
195 * Turn off underscoring for x86_64 PE+-COFF targets. For old behavior the
196 option --enable-leading-mingw64-underscores can be used on configure of
199 * Add support for the TMS320C6000 (TI C6X) processor family.
201 * --add-needed renamed to --copy-dt-needed-entries in order to avoid confusion
202 with --as-needed option.
204 * Extend .def file syntax by '== <ID>' for imports and exports. This allows
205 to alias the import/export table name written in PE image.
207 * Add --exclude-all-symbols option to PE based linkers. This prevents all
208 symbols from automatically being exported.
210 * Add support for the Renesas RX processor.
212 * Add support for alpha-vms target.
216 * GNU/Linux targets now support the STB_GNU_UNIQUE symbol binding. This is a
217 GNU extension to the standard set of ELF symbol bindings. The binding will
218 be passed on to the dynamic linker which will make sure that in the entire
219 process there is just one symbol with the given name and type in use.
221 * PE targets now support a GNU extension to allow the alignment of common
222 common symbols to be specified. This support uses custom options in
223 the .drectve section, which will be disregarded by the native tools.
225 * PE targets now add primitive support for ELF version scripts; symbols
226 are not versioned, but the local and global symbol visibility directives
227 are respected when filtering symbols in auto-export mode.
229 * New option --no-export-dynamic to undo the effect of the -E and
230 --export-dynamic options.
232 * ELF: --warn-alternate-em option to warn if an object has alternate
235 * New script function REGION_ALIAS to add alias names to memory regions.
237 * PE targets no longer make use of the long section names PE extension to
238 the COFF format when generating executable images, by default. The old
239 (slightly non-conformant) behaviour can still be invoked by using the
240 new '--enable-long-section-names' command-line option. It is also enabled
241 automatically in the presence of un-stripped debug information, as GDB
242 needs to be able to find the debug info sections by their full names.
244 * For GNU/Linux systems the linker will now avoid processing any relocations
245 made against symbols of the STT_GNU_IFUNC type and instead emit them into
246 the resulting binary for processing by the loader.
248 * --as-needed now links in a dynamic library if it satisfies undefined
249 symbols in regular objects, or in other dynamic libraries. In the
250 latter case the library is not linked if it is found in a DT_NEEDED
251 entry of one of the libraries already linked.
253 * Add a new command line option, -Ttext-segment ADDR, for ELF targets
254 to set the address of the first byte of the text segment.
256 * Add support for Sunplus score architecture.
258 * Add new option --use-nul-prefixed-import-tables to ld for PE targets to
259 allow fallback to old import table generation with null element prefix.
261 * Windows PE systems now support a new --exclude-modules-for-implib option,
262 allowing users to partition object files and archive members between a DLL
263 and its associated import library as they are generated during linking.
265 * Add support for Lattice Mico32 (lm32) architecture.
267 * Add CR16 ELF --embedded-relocs (used to embedded relocations into binaries
268 for Embedded-PIC code) option.
270 * Add to the PE/PE+ targets the support of two different kinds of
271 pseudo-relocations. They can be selected by the switches
272 --enable-runtime-pseudo-reloc-v1 and --enable-runtime-pseudo-reloc-v2.
273 For the switch --enable-runtime-pseudo-reloc it uses for 32-bit
274 runtime pseudo relocation version one, for 64-bit the version two.
278 * Linker scripts support a new INSERT command that makes it easier to
279 augment the default script.
281 * Linker script input section filespecs may now specify a file within an
282 archive by writing "archive:file".
284 * The --sort-common switch now has an optional argument which specifies the
285 direction of sorting.
287 * The M68K linker now supports multiple GOT generation schemes controlled via
288 the --got=<type> command line option.
290 * The ARM EABI linker will now generate stubs for function calls to symbols
291 that are too far away. The placement of the stubs is controlled by a new
292 linker command line option: --stub-group-size=N.
296 * Linker sources now released under version 3 of the GNU General Public
299 * ELF: New --build-id option to generate a unique per-binary identifier
300 embedded in a note section.
302 * Added support for National Semicondutor CompactRISC (ie CR16) target.
304 * -l:foo now searches the library path for a filename called foo,
305 without converting it to libfoo.a or libfoo.so.
307 * Add a new command line option '--default-script=FILE' or '-dT FILE'
308 which specifies a replacement for the built in, default linker
311 * ELF: Add -Bsymbolic-functions, --dynamic-list-cpp-new, which puts C++
312 operator new and delete on the dynamic list, and --dynamic-list-data,
313 builtin list for --dynamic-list, which puts global data symbols on the
316 * Add support for x86_64 PE+ target.
318 * Add support for Score target.
320 * ELF: Add --dynamic-list option to specify a list of global symbols
321 whose references shouldn't be bound to the definition within the
322 shared library, or a list of symbols which should be added to the
323 symbol table in the executable.
325 * The default output section LMA has changed for allocatable sections from
326 being equal to VMA, to keeping the difference between LMA and VMA the same as
327 the previous output section in the same region. This is a more useful
328 default when using overlays and other cases where you specify an LMA
329 differing from the VMA for some sections.
331 * New switch: --print-gc-sections to list any sections removed by garabge
334 * ARM: Added --vfp11-denorm-fix option to work around an erratum in current
339 * Support for the Infineon XC16X has been added by KPIT Cummins Infosystems.
341 * Modify the Linux linker search order to better match ld.so search order.
342 Look for DT_NEEDED libraries in paths specified by ld.so.conf before
343 searching the default directories, rather than vice versa.
344 Use $prefix/etc/ld.so.conf if it exists, otherwise /etc/ld.so.conf.
346 * PE-COFF: Forward exports from DLL's can now be specified in .def files
347 passed directly to ld.
349 * Support for the Z80 processor family has been added.
351 * Add support for the "@<file>" syntax to the command line, so that extra
352 switches can be read from <file>.
356 * Support for the R_ARM_V4BX relocation as defined in the ARM AAELF
357 specification has been added via the --fix-v4bx command-line option.
359 * New linker script construct AS_NEEDED(), which sets the --as-needed flag
360 for input files listed inside of it.
362 * A new command-line option, --sysroot, can be used to override the
363 default sysroot location. It only applies to toolchains that were
364 configured using --with-sysroot.
366 * New linker script functions: ORIGIN() and LENGTH() which return information
367 about a specified memory region.
369 * Port to MAXQ processor contributed by HCL Tech.
371 * Added SEGMENT_START to the linker script language to permit the user to
372 override the base address for a segment from the command-line.
374 * ELF: --warn-shared-textrel option to warn if adding a DT_TEXTREL to a shared
377 * Added SORT_BY_NAME and SORT_BY_ALIGNMENT to the linker script
378 language to permit sorting sections by section name or section
381 * Added a new linker command line switch, --sort-section name|alignment,
382 to sort sections by section name or maximum alignment.
384 * ELF: --add-needed/--no-add-needed options to control if a DT_NEEDED tag
385 should be added when a shared library comes from DT_NEEDED tags.
387 * Support for the crx-elf target added.
389 * Support for the sh-symbianelf target added.
391 * A new linker command line switch has been added which allows the hash table
392 size to be set to a suitable prime value near to its argument. This switch
393 is --hash-size=<NUMBER>. Also if the switch --reduce-memory-overheads is
394 used, and --hash-size has not been used, then the default value will be set
397 * Linker map files are now generated with an O(N) algorithm for finding symbols
398 that are defined in each section. This uses about 40% more memory for
399 symbols than the old O(N^2) algorithm. You can use the new
400 --reduce-memory-overheads option to select the old algorithm; this option
401 might also be used in the future to select similar tradeoffs.
405 * ELF: --as-needed/--no-as-needed options to control if a DT_NEEDED tag should
406 be added only when a shared library is referenced.
408 * PE: --large-address-aware option to indicate executables support virtual
409 addresses greater than 2 gigabytes.
411 * DWARF 2 support for i386pe added.
413 * The linker script operator DEFINED() will now yield 1 only for a symbol that
414 is defined before the statement where DEFINED is used.
416 * The MIPS --embedded-relocs (used to embed relocations into binaries for
417 Embedded-PIC code) is deprecated and will be removed in a future release.
419 * cr16c support added by NSC.
421 * m32r Linux (ELF) support added by Renesas.
423 * Improved linker's handling of unresolved symbols. The switch
424 --unresolved-symbols=<method> has been added to tell the linker when it
425 should report them and the switch --warn-unresolved-symbols has been added to
426 make reports be issued as warning messages rather than errors.
430 * Added support for Xtensa architecture.
432 * Added --with-sysroot configure switch to specify a target system root, for
433 linking against a target filesystem image.
435 * Added --accept-unknown-linker-format to restore old linker behaviour (pre
436 2.14) of silently accepting and linking in any files in an unknown binary
439 * Added --no-omagic to undo the effects of the -N option.
441 * Support for Texas Instruments TMS320C4x and TMS320C3x series of
442 DSP's contributed by Michael Hayes and Svein E. Seldal.
444 * Added --with-lib-path configure switch to specify default value for
447 * ARM port to QNX operating system added by Graeme Peterson.
449 * IP2K support added by Denis Chertykov.
453 * Support for the Fujitsu FRV architecture added by Red Hat. Models for FR400
456 Changes in version 2.13:
458 * DEC VAX ELF support, by Matt Thomas.
460 Changes in version 2.12:
462 * Support for Don Knuth's MMIX, by Hans-Peter Nilsson.
464 * Support for the OpenRISC 32-bit embedded processor by OpenCores.
466 * Support for -z nocopyreloc in the x86 ELF linker, which disables
467 production of copy relocs. Warning: using this option may result in
468 non-sharable applications.
470 * Support for -z combreloc in the ELF linker, which puts dynamic
471 relocations against the same symbol together, so that dynamic linker
472 can use an one-entry symbol lookup cache.
474 * Support for ELF SHF_MERGE section merging, by Jakub Jelinek.
476 Changes in version 2.11:
478 * Support for AMD x86-64 architecture, by Jan Hubicka, SuSE Labs.
480 * Support added for eliminating duplicate DWARF2 debug information by
481 having the compiler generate the information in sections called
482 .gnu.linkonce.wi.XXXX where XXXX is a checksum for the contents. The
483 linker then merges these sections together into the normal .debug_info
486 * The native ELF linker now searches the directories in DT_RUNPATH or
487 DT_RPATH of a shared library for shared libraries needed by it.
489 * TI C54x support, by Timothy Wall.
491 * Added command line switch --section-start to set the start address of any
494 * Added ability to emit full relocation information in linked executables,
495 enabled by --emit-relocs. Some post-linkage optimization tools need
496 this information in order to be able to correctly identify and perform
497 symbol relative addressing in the event of changes in section contents
498 (instructions being added or deleted, extending data sections, etc.)
500 * Support for i860, by Jason Eckhardt (preliminary, alpha quality).
502 * Support for CRIS (Axis Communications ETRAX series).
504 * Support for PDP-11 and 2.11BSD a.out format, by Lars Brinkhoff.
506 Changes in version 2.10:
508 * Added AT> to the linker script language to allow load-time allocation of
509 sections into regions.
511 * Added garbage collection of unused sections, enabled by --gc-sections.
512 It does require a bit of backend support; currently implemented are
513 arm-elf, avr-elf, d10v-elf, fr30-elf, i386-elf, m32r-elf, m68k-elf,
514 mcore-elf, mips-elf, mn10300-elf, ppc-elf, sh-elf, sparc-elf, and v850-elf.
515 Others will ignore the option.
517 * Added SORT to the linker script language to permit sorting sections by file
518 name or section name.
520 * Added EXTERN to the linker script language as an equivalent to the -u
523 * Added ASSERT to the linker script language.
525 * Added EXCLUDE_FILE to the linker script language for further control over
528 * Added -O option to optimize linker output (as of this writing, this only
529 affects ELF shared library generation).
531 * The -e option now accepts a number as well as a symbol name.
533 * Added --no-undefined option to disallow undefined symbols when creating a
536 * The linker now issues a warning, not an error, for an undefined symbol when
537 using -Bsymbolic; use the new --no-undefined option to get the old
540 * Added --demangle and --no-demangle options.
542 Changes in version 2.9:
544 * Added SQUAD to the linker script language.
546 * New option --no-warn-mismatch.
548 * The MEMORY command now parses the attributes to determine where sections that
549 are not placed in a specific memory region are placed.
551 Changes in version 2.8:
553 * Linker scripts may now contain shell wildcard characters for file and section
556 * The linker now supports symbol versions in ELF.
558 * The NOCROSSREFS command was added to the linker script language.
560 * The LOADADDR expression was added to the linker script language.
562 * MAX and MIN functions were added to the linker script language.
564 * The OVERLAY construct was added to the linker script language.
566 * New option --warn-section-align to warn when the address of an output section
567 changes due to alignment of an input section.
569 * New options --filter/-F and --auxiliary/-f.
571 Changes in version 2.7:
573 * New option --cref to print out a cross reference table.
575 * New option --wrap SYMBOL.
577 * New option --no-whole-archive, to turn off the effect of --whole-archive.
579 * Input sections assigned to the output section /DISCARD/ in the linker script
580 are not included in the output file.
582 * The SunOS and ELF linkers now merge stabs debugging information which uses
583 the N_BINCL and N_EINCL stab types. This reduces the amount of debugging
584 information generated.
586 Changes in version 2.6:
588 * When an ELF section name is representable as a C identifier (this is not true
589 of most ELF section names), the linker will automatically define symbols
590 __start_SECNAME and __stop_SECNAME, where SECNAME is the section name, at the
591 beginning and the end of the section. This is used by glibc.
593 Addendum: Current versions of the linker (at least for version 2.18 onwards
594 and possibly much earlier as well) place two restrictions on this feature: The
595 symbols are only implemented for orphaned sections, not for explicitly placed
596 sections and they are PROVIDEd rather than being defined.
598 * When an ELF section named .gnu.warning is encountered in an input file, the
599 contents of the section are displayed as an error message, and the section is
600 not copied into the output file. This is used by glibc.
602 * When an ELF section named .gnu.warning.SYMBOL is encountered in an input
603 file, and the symbol SYMBOL is referenced by some object file, the contents of
604 the section are displayed as an error message. The section is not copied into
605 the output file, unless doing a relocatable or shared link. This is used by
608 * New options -split-by-reloc and -split-by-file.
610 * The linker now supports linking PIC compiled code on SPARC SunOS. It can
611 also create SPARC SunOS shared libraries, and, like the native SunOS linker,
612 will do so whenever there is an undefined symbol in the link and neither the -e
613 nor the -r option was used.
615 * The -rpath option may be used on SunOS to set the list of directories to be
616 searched at run time. This overrides the default of building the list from the
619 * The COFF linker now combines debugging information for structs, unions, and
620 enums, so that even if the same type is defined in multiple input files it will
621 only be defined once in the output file. The --traditional-format switch will
622 prevent this optimization.
624 Changes in version 2.5:
626 * The linker now supports linking against SunOS shared libraries. It still can
627 not link SunOS PIC (Position Independent Code) files, so it can not be used to
628 generate shared libraries.
630 * The linker now supports linking against ELF shared libraries for the i386
631 (UnixWare) and SPARC (Solaris). It can also link ELF PIC files, and can be
632 used to generate shared libraries. Shared library generation is not well
633 tested; please report any problems encountered. The linker is now enabled for
636 * Eric Youngdale has contributed Linux support code, including linking against
637 Linux a.out shared libraries. The linker produces Linux QMAGIC binaries.
639 * The ELF backend has been converted to the new linker code. To use the new
640 ELF linker, each particular target requires a relocation function. So far,
641 this function has been written for i386 (UnixWare), SPARC (Solaris) MIPS (Irix
642 5), and HPPA ELF targets.
644 * The -( (--start-group) and -) (--end-group) options have been added to
645 support searching a group of archives as though they were a single archive.
646 This can also be used in a linker script, as GROUP ( files ).
648 * When a file is named on the command line, and the linker does not recognize
649 it as an object file, the linker will now treat the file as a linker script
650 file. A linker script named in this way augments, but does not replace, the
651 default linker script.
653 * The -warn-once option was added. It causes the linker to only warn once per
654 undefined symbol, rather than once per reference.
656 * The COFF backend has been converted to the new linker code. As with ELF, to
657 use the new linker, each particular target requires a relocation function. So
658 far, this function has been written for the i386, m68k, a29k and SH targets.
660 * The -V flag was made a synonym for -v, for SVR4 compatibility. The old -V
661 behaviour is available via --verbose.
663 Changes in version 2.4:
665 * New linker code, by Steve Chamberlain and Ian Taylor. For a.out and ecoff
666 formats (so far), this should result in considerable savings in time
667 and memory used while linking; slightly poorer performance than
668 before for formats not converted yet.
670 * Command-line parsing is no longer done with flex. This means
671 oddball characters in filenames won't get treated as argument
674 * HP-PA ELF support, by Jeff Law. (No SOM support yet.)
676 * Mach i386 support, by David Mackenzie.
678 * Irix 4 shared libraries are now supported (Irix 5 uses ELF, and ELF shared
679 libraries are not yet supported).
681 * COFF shared libraries (as on SCO) should work as well.
683 * The linker is disabled for Solaris. (Actually, it was in 2.3 also, I just
684 forgot to note it.) Some of their C library routines don't work when
685 statically linked, and the GNU linker doesn't support dynamic linking yet.
687 Changes in version 2.3:
689 * Weak symbols are now supported.
691 * ELF support has been added. The linker has been bootstrapped on
692 UnixWare and Solaris.
694 * Alpha OSF/1 support has been added (non dynamic linking only).
696 Changes in version 2.2:
698 * The `bfd' library has been updated to reduce a.out-format string
699 table size. The effect of this is that files linked from many input
700 files with duplicate symbols (`-g' debugging records, or identical
701 static symbols) should be much smaller.
703 Changes in version 2.1:
705 * The ld -ySYMBOL flag (to trace references to SYMBOL) is now implemented.
707 * There is now support for writing ECOFF files, so ld and the
708 other utilities should work on Risc/Ultrix and Irix.
711 Copyright (C) 2012-2017 Free Software Foundation, Inc.
713 Copying and distribution of this file, with or without modification,
714 are permitted in any medium without royalty provided the copyright
715 notice and this notice are preserved.