From ff12f303355b20de1260bc1d007f973bd02615dc Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 3 Jan 1997 22:09:40 +0000 Subject: Fri Jan 3 16:58:31 1997 Richard Henderson elf64-alpha multiple .got rewrite: * elf-bfd.h (struct elf_backend_data): Add always_size_sections entry. (bfd_elf*_mkobject): Don't define here ... * elfxx-target.h: ... but rather here. Default always_size_sections hook to NULL. * elf.c (elf_mkobject): Rename to bfd_elf_mkobject, since that was what the #defines in elf-bfd.h transmuted it to anyway. * section.c: Add SEC_LINKER_CREATED flag. * bfd-in2.h: Rebuild. * elf32-i386.c (elf_i386_check_relocs): Add SEC_LINKER_CREATED to relocation section flags. (elf_i386_size_dynamic_sections): Use SEC_LINKER_CREATED instead of SEC_IN_MEMORY to recognize generated bits. * elf32-m68k.c (elf_m68k_check_relocs, elf_m68k_size_dynamic_sections): Likewise. * elf32-mips.c (mips_elf_final_link, mips_elf_create_dynamic_sections, mips_elf_create_compact_rel_section, mips_elf_create_got_section, mips_elf_check_relocs, mips_elf_size_dynamic_sections): Likewise. * elf32-ppc.c (ppc_elf_create_linker_section, ppc_elf_size_dynamic_sections): Likewise. * elf32-sparc.c (elf32_sparc_check_relocs, elf32_sparc_size_dynamic_sections): Likewise. * elflink.c (_bfd_elf_create_got_section): Add SEC_LINKER_CREATED to section flags. (_bfd_elf_create_dynamic_sections): Likewise. (_bfd_elf_make_linker_section_rela): Likewise. * elflink.h (elf_link_create_dynamic_sections): Likewise. (bfd_elf,size_dynamic_sections): Call the always_size_sections hook. (elf_bfd_final_link): Use SEC_LINKER_CREATED instead of SEC_IN_MEMORY to identify generated bits. (elf_link_input_bfd): Likewise. * elf64-alpha.c: Rewrite everything touching relocations. --- bfd/section.c | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'bfd/section.c') diff --git a/bfd/section.c b/bfd/section.c index 469b026..564a51e 100644 --- a/bfd/section.c +++ b/bfd/section.c @@ -240,7 +240,7 @@ CODE_FRAGMENT . sections. *} .#define SEC_COFF_SHARED_LIBRARY 0x800 . -. {* The section is a common section (symbols may be defined +. {* The section contains common symbols (symbols may be defined . multiple times, the value of a symbol is the amount of . space it requires, and the largest symbol value is the one . used). Most targets have exactly one of these (which we @@ -269,6 +269,40 @@ CODE_FRAGMENT . table. *} .#define SEC_SORT_ENTRIES 0x80000 . +. {* When linking, duplicate sections of the same name should be +. discarded, rather than being combined into a single section as +. is usually done. This is similar to how common symbols are +. handled. See SEC_LINK_DUPLICATES below. *} +.#define SEC_LINK_ONCE 0x100000 +. +. {* If SEC_LINK_ONCE is set, this bitfield describes how the linker +. should handle duplicate sections. *} +.#define SEC_LINK_DUPLICATES 0x600000 +. +. {* This value for SEC_LINK_DUPLICATES means that duplicate +. sections with the same name should simply be discarded. *} +.#define SEC_LINK_DUPLICATES_DISCARD 0x0 +. +. {* This value for SEC_LINK_DUPLICATES means that the linker +. should warn if there are any duplicate sections, although +. it should still only link one copy. *} +.#define SEC_LINK_DUPLICATES_ONE_ONLY 0x200000 +. +. {* This value for SEC_LINK_DUPLICATES means that the linker +. should warn if any duplicate sections are a different size. *} +.#define SEC_LINK_DUPLICATES_SAME_SIZE 0x400000 +. +. {* This value for SEC_LINK_DUPLICATES means that the linker +. should warn if any duplicate sections contain different +. contents. *} +.#define SEC_LINK_DUPLICATES_SAME_CONTENTS 0x600000 +. +. {* This section was created by the linker as part of dynamic +. relocation or other arcane processing. It is skipped when +. going through the first-pass output, trusting that someone +. else up the line will take care of it later. *} +.#define SEC_LINKER_CREATED 0x800000 +. . {* End of section flags. *} . . {* Some internal packed boolean fields. *} @@ -982,6 +1016,6 @@ DESCRIPTION Not enough memory exists to create private data for @var{osec}. .#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ -. BFD_SEND (ibfd, _bfd_copy_private_section_data, \ +. BFD_SEND (obfd, _bfd_copy_private_section_data, \ . (ibfd, isection, obfd, osection)) */ -- cgit v1.1