summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils/bfd/section.c
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1996-06-10 10:55:58 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1996-06-10 10:55:58 +0000
commita7e831079363e3bb45f3172f6e59ba48e335682b (patch)
treeee4324eac9a9d66f189fab60498ec42b8226b7fc /gnu/usr.bin/binutils/bfd/section.c
parent467cb0a471d13c5186a6ee166e60b47c30da64e9 (diff)
Bring Cygnus versions into the trunk, keeping our local patches
Diffstat (limited to 'gnu/usr.bin/binutils/bfd/section.c')
-rw-r--r--gnu/usr.bin/binutils/bfd/section.c68
1 files changed, 57 insertions, 11 deletions
diff --git a/gnu/usr.bin/binutils/bfd/section.c b/gnu/usr.bin/binutils/bfd/section.c
index 509a5057ed8..c879ffd7fc2 100644
--- a/gnu/usr.bin/binutils/bfd/section.c
+++ b/gnu/usr.bin/binutils/bfd/section.c
@@ -1,5 +1,5 @@
/* Object file "section" support for the BFD library.
- Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+ Copyright (C) 1990, 91, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
Written by Cygnus Support.
This file is part of BFD, the Binary File Descriptor library.
@@ -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
@@ -259,8 +259,59 @@ CODE_FRAGMENT
. memory if appropriate. *}
.#define SEC_IN_MEMORY 0x20000
.
+. {* The contents of this section are to be excluded by the
+. linker for executable and shared objects unless those
+. objects are to be further relocated. *}
+.#define SEC_EXCLUDE 0x40000
+.
+. {* The contents of this section are to be sorted by the
+. based on the address specified in the associated symbol
+. 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
+.
. {* End of section flags. *}
.
+. {* Some internal packed boolean fields. *}
+.
+. {* See the vma field. *}
+. unsigned int user_set_vma : 1;
+.
+. {* Whether relocations have been processed. *}
+. unsigned int reloc_done : 1;
+.
+. {* A mark flag used by some of the linker backends. *}
+. unsigned int linker_mark : 1;
+.
+. {* End of internal packed boolean fields. *}
+.
. {* The virtual memory address of the section - where it will be
. at run time. The symbols are relocated against this. The
. user_set_vma flag is maintained by bfd; if it's not set, the
@@ -269,7 +320,6 @@ CODE_FRAGMENT
. target and various flags). *}
.
. bfd_vma vma;
-. boolean user_set_vma;
.
. {* The load address of the section - where it would be in a
. rom image; really only used for writing section header
@@ -370,7 +420,6 @@ CODE_FRAGMENT
.
. bfd *owner;
.
-. boolean reloc_done;
. {* A symbol which points at this section only *}
. struct symbol_cache_entry *symbol;
. struct symbol_cache_entry **symbol_ptr_ptr;
@@ -429,9 +478,9 @@ static const asymbol global_syms[] =
#define STD_SECTION(SEC, FLAGS, SYM, NAME, IDX) \
const asymbol * const SYM = (asymbol *) &global_syms[IDX]; \
const asection SEC = \
- { NAME, 0, 0, FLAGS, 0, false, 0, 0, 0, 0, (asection *) &SEC, \
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (boolean) 0, \
- (asymbol *) &global_syms[IDX], (asymbol **) &SYM, }
+ { NAME, 0, 0, FLAGS, 0, 0, 0, 0, 0, 0, 0, 0, (asection *) &SEC, \
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
+ (asymbol *) &global_syms[IDX], (asymbol **) &SYM, 0, 0 }
STD_SECTION (bfd_com_section, SEC_IS_COMMON, bfd_com_symbol,
BFD_COM_SECTION_NAME, 0);
@@ -561,10 +610,7 @@ bfd_make_section_anyway (abfd, name)
newsect = (asection *) bfd_zalloc (abfd, sizeof (asection));
if (newsect == NULL)
- {
- bfd_set_error (bfd_error_no_memory);
- return NULL;
- }
+ return NULL;
newsect->name = name;
newsect->index = abfd->section_count++;