summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@libertysurf.fr>2005-01-09 09:26:55 +0000
committerEric Botcazou <ebotcazou@libertysurf.fr>2005-01-09 09:26:55 +0000
commit151e5294b9ef862ec0b117e92bb1ea4ede62324d (patch)
tree9e1e2b6b8f5a2a8ff1b1a793cb54a8eb9138cba6
parent4743eb500938c0fb7bf5b2fe7ee5f04087637c63 (diff)
downloadppe42-binutils-151e5294b9ef862ec0b117e92bb1ea4ede62324d.tar.gz
ppe42-binutils-151e5294b9ef862ec0b117e92bb1ea4ede62324d.zip
* elf32-sparc.c (elf32_sparc_omit_section_dynsym): New function.
(elf_backend_omit_section_dynsym): Define to it. * elf64-sparc.c (sparc64_elf_omit_section_dynsym): New function. (elf_backend_omit_section_dynsym): Define to it.
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/elf32-sparc.c20
-rw-r--r--bfd/elf64-sparc.c21
3 files changed, 48 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 309f84b00d..4f25e96293 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2005-01-09 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * elf32-sparc.c (elf32_sparc_omit_section_dynsym): New function.
+ (elf_backend_omit_section_dynsym): Define to it.
+ * elf64-sparc.c (sparc64_elf_omit_section_dynsym): New function.
+ (elf_backend_omit_section_dynsym): Define to it.
+
2005-01-07 Jakub Jelinek <jakub@redhat.com>
* bfd/elf.c (INCLUDE_SECTION_IN_SEGMENT): Don't put empty sections into
diff --git a/bfd/elf32-sparc.c b/bfd/elf32-sparc.c
index 378f14db4b..be3dfae3e1 100644
--- a/bfd/elf32-sparc.c
+++ b/bfd/elf32-sparc.c
@@ -39,6 +39,8 @@ static bfd_boolean allocate_dynrelocs
PARAMS ((struct elf_link_hash_entry *, PTR));
static bfd_boolean readonly_dynrelocs
PARAMS ((struct elf_link_hash_entry *, PTR));
+static bfd_boolean elf32_sparc_omit_section_dynsym
+ PARAMS ((bfd *, struct bfd_link_info *, asection *));
static bfd_boolean elf32_sparc_size_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
static bfd_boolean elf32_sparc_new_section_hook
@@ -1814,6 +1816,23 @@ readonly_dynrelocs (h, inf)
return TRUE;
}
+/* Return true if the dynamic symbol for a given section should be
+ omitted when creating a shared library. */
+
+static bfd_boolean
+elf32_sparc_omit_section_dynsym (bfd *output_bfd,
+ struct bfd_link_info *info,
+ asection *p)
+{
+ /* We keep the .got section symbol so that explicit relocations
+ against the _GLOBAL_OFFSET_TABLE_ symbol emitted in PIC mode
+ can be turned into relocations against the .got symbol. */
+ if (strcmp (p->name, ".got") == 0)
+ return FALSE;
+
+ return _bfd_elf_link_omit_section_dynsym (output_bfd, info, p);
+}
+
/* Set the sizes of the dynamic sections. */
static bfd_boolean
@@ -3448,6 +3467,7 @@ elf32_sparc_plt_sym_val (bfd_vma i ATTRIBUTE_UNUSED,
#define elf_backend_check_relocs elf32_sparc_check_relocs
#define elf_backend_adjust_dynamic_symbol \
elf32_sparc_adjust_dynamic_symbol
+#define elf_backend_omit_section_dynsym elf32_sparc_omit_section_dynsym
#define elf_backend_size_dynamic_sections \
elf32_sparc_size_dynamic_sections
#define elf_backend_relocate_section elf32_sparc_relocate_section
diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c
index 6ffad929a7..c7c9c4dd97 100644
--- a/bfd/elf64-sparc.c
+++ b/bfd/elf64-sparc.c
@@ -56,6 +56,8 @@ static bfd_boolean sparc64_elf_check_relocs
const Elf_Internal_Rela *));
static bfd_boolean sparc64_elf_adjust_dynamic_symbol
PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *));
+static bfd_boolean sparc64_elf_omit_section_dynsym
+ PARAMS ((bfd *, struct bfd_link_info *, asection *));
static bfd_boolean sparc64_elf_size_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *));
static int sparc64_elf_get_symbol_type
@@ -1760,6 +1762,23 @@ sparc64_elf_adjust_dynamic_symbol (info, h)
return TRUE;
}
+/* Return true if the dynamic symbol for a given section should be
+ omitted when creating a shared library. */
+
+static bfd_boolean
+sparc64_elf_omit_section_dynsym (bfd *output_bfd,
+ struct bfd_link_info *info,
+ asection *p)
+{
+ /* We keep the .got section symbol so that explicit relocations
+ against the _GLOBAL_OFFSET_TABLE_ symbol emitted in PIC mode
+ can be turned into relocations against the .got symbol. */
+ if (strcmp (p->name, ".got") == 0)
+ return FALSE;
+
+ return _bfd_elf_link_omit_section_dynsym (output_bfd, info, p);
+}
+
/* Set the sizes of the dynamic sections. */
static bfd_boolean
@@ -3198,6 +3217,8 @@ const struct elf_size_info sparc64_elf_size_info =
sparc64_elf_check_relocs
#define elf_backend_adjust_dynamic_symbol \
sparc64_elf_adjust_dynamic_symbol
+#define elf_backend_omit_section_dynsym \
+ sparc64_elf_omit_section_dynsym
#define elf_backend_size_dynamic_sections \
sparc64_elf_size_dynamic_sections
#define elf_backend_relocate_section \
OpenPOWER on IntegriCloud