diff options
author | Alan Modra <amodra@gmail.com> | 2006-10-17 13:41:49 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2006-10-17 13:41:49 +0000 |
commit | 74541ad4c01323646d5bebe7ff10828f84af0f49 (patch) | |
tree | 290813ab87157e643bf32d7271cecb1dc394179d /ld/ld.texinfo | |
parent | 21643204152d14c5e9c32a56ef6dfd1b4067cf28 (diff) | |
download | gdb-74541ad4c01323646d5bebe7ff10828f84af0f49.zip gdb-74541ad4c01323646d5bebe7ff10828f84af0f49.tar.gz gdb-74541ad4c01323646d5bebe7ff10828f84af0f49.tar.bz2 |
bfd/
* elf-bfd.h (struct elf_link_hash_table): Reorder. Add
text_index_section and data_index_section.
(struct elf_backend_data): Add elf_backend_init_index_section.
(_bfd_elf_init_1_index_section): Declare.
(_bfd_elf_init_2_index_sections): Declare.
* elfxx-target.h (elf_backend_init_index_section): Define.
(elfNN_bed): Init new field.
* elflink.c (_bfd_elf_link_omit_section_dynsym): Keep first tls
section and text_index_section plus data_index_section.
(_bfd_elf_link_renumber_dynsyms): Clear dynindx on omitted sections.
(_bfd_elf_init_1_index_section): New function.
(_bfd_elf_init_2_index_sections): New function.
(bfd_elf_size_dynsym_hash_dynstr): Call elf_backend_init_index_section.
(elf_link_input_bfd): When emitting relocs, use text_index_section
and data_index_section for removed sections.
* elf-m10300.c (elf_backend_omit_section_dynsym): Define.
* elf32-i386.c: Likewise.
* elf32-m32r.c: Likewise.
* elf32-sh.c: Likewise.
* elf32-xstormy16.c: Likewise.
* elf32-xtensa.c: Likewise.
* elf64-alpha.c: Likewise.
* elf64-hppa.c: Likewise.
* elf64-mmix.c: Likewise.
* elf64-sh64.c: Likewise.
* elfxx-ia64.c: Likewise.
* elf32-arm.c (elf32_arm_final_link_relocate): Use text_index_section
and data_index_section sym for relocs against sections with no dynamic
section sym.
(elf_backend_init_index_section): Define.
* elf32-cris.c: Similarly.
* elf32-hppa.c: Similarly.
* elf32-i370.c: Similarly.
* elf32-m68k.c: Similarly.
* elf32-mips.c: Similarly.
* elf32-ppc.c: Similarly.
* elf32-s390.c: Similarly.
* elf32-sparc.c: Similarly.
* elf32-vax.c: Similarly.
* elf64-mips.c: Similarly.
* elf64-ppc.c: Similarly.
* elf64-s390.c: Similarly.
* elf64-sparc.c: Similarly.
* elf64-x86-64.c: Similarly.
* elfn32-mips.c: Similarly.
* elfxx-mips.c: Similarly.
* elfxx-sparc.c: Similarly.
* linker.c (fix_syms): Base symbols in removed sections on
previous section in preference to using absolute section.
ld/
* ldlang.c (strip_excluded_output_sections): Do strip sections
that define syms, but don't ignore them.
* ld.texinfo (Output Section Discarding): Revise.
* emultempl/armcoff.em (gld${EMULATION_NAME}_finish): Always call
finish_default.
ld/testsuite/
Update for section sym changes.
Diffstat (limited to 'ld/ld.texinfo')
-rw-r--r-- | ld/ld.texinfo | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/ld/ld.texinfo b/ld/ld.texinfo index 6835147..1fbd6ef 100644 --- a/ld/ld.texinfo +++ b/ld/ld.texinfo @@ -3684,21 +3684,23 @@ scripts. @cindex discarding sections @cindex sections, discarding @cindex removing sections -The linker will not create output section which do not have any -contents. This is for convenience when referring to input sections that -may or may not be present in any of the input files. For example: +The linker will not create output sections with no contents. This is +for convenience when referring to input sections that may or may not +be present in any of the input files. For example: @smallexample .foo : @{ *(.foo) @} @end smallexample @noindent will only create a @samp{.foo} section in the output file if there is a -@samp{.foo} section in at least one input file. - -If you use anything other than an input section description as an output -section command, such as a symbol assignment, then the output section -will always be created, even if there are no matching input sections. -When a section is discarded, its address (@xref{Output Section Address}) -will also be ignored. +@samp{.foo} section in at least one input file, and if the input +sections are not all empty. Other link script directives that allocate +space in an output section will also create the output section. + +The linker will ignore address assignments (@xref{Output Section Address}) +on discarded output sections, except when the linker script defines +symbols in the output section. In that case the linker will obey +the address assignments, possibly advancing dot and/or current lma +even though the section is discarded. @cindex /DISCARD/ The special output section name @samp{/DISCARD/} may be used to discard |