aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-m68k.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1997-06-11 16:59:00 +0000
committerIan Lance Taylor <ian@airs.com>1997-06-11 16:59:00 +0000
commit8519ea2120056aed56c20011dca7c4d72d806a61 (patch)
tree06039844f5c6bff006dbe5742ef9841c6dfd620f /bfd/elf32-m68k.c
parentb4a3d2217687d8f8706285ba423dfb3430890f11 (diff)
downloadgdb-8519ea2120056aed56c20011dca7c4d72d806a61.zip
gdb-8519ea2120056aed56c20011dca7c4d72d806a61.tar.gz
gdb-8519ea2120056aed56c20011dca7c4d72d806a61.tar.bz2
* elflink.h (elf_link_output_extsym): Call finish_dynamic_symbol
for a symbol which is being forced to be local. * elf32-i386.c (elf_i386_relocate_section): Write out the relocation value for a GOT reloc for a symbol which is turning into a local symbol. (elf_i386_finish_dynamic_symbol): If a symbol is turning into a local symbol, write out a RELATIVE reloc rather than a GLOB_DAT reloc. * elf32-m68k.c, elf32-sparc.c: Corresponding changes.
Diffstat (limited to 'bfd/elf32-m68k.c')
-rw-r--r--bfd/elf32-m68k.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
index fe24d4b..1d763a9 100644
--- a/bfd/elf32-m68k.c
+++ b/bfd/elf32-m68k.c
@@ -1125,7 +1125,7 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
"_GLOBAL_OFFSET_TABLE_") != 0))
&& elf_hash_table (info)->dynamic_sections_created
&& (! info->shared
- || ! info->symbolic
+ || (! info->symbolic && h->dynindx != -1)
|| (h->elf_link_hash_flags
& ELF_LINK_HASH_DEF_REGULAR) == 0))
|| (info->shared
@@ -1197,16 +1197,17 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
if (!elf_hash_table (info)->dynamic_sections_created
|| (info->shared
- && info->symbolic
+ && (info->symbolic || h->dynindx == -1)
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
{
/* This is actually a static link, or it is a
-Bsymbolic link and the symbol is defined
- locally. We must initialize this entry in the
- global offset table. Since the offset must
- always be a multiple of 4, we use the least
- significant bit to record whether we have
- initialized it already.
+ locally, or the symbol was forced to be local
+ because of a version file.. We must initialize
+ this entry in the global offset table. Since
+ the offset must always be a multiple of 4, we
+ use the least significant bit to record whether
+ we have initialized it already.
When doing a dynamic link, we create a .rela.got
relocation entry to initialize the value. This
@@ -1607,8 +1608,6 @@ elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym)
/* This symbol has an entry in the global offset table. Set it
up. */
- BFD_ASSERT (h->dynindx != -1);
-
sgot = bfd_get_section_by_name (dynobj, ".got");
srela = bfd_get_section_by_name (dynobj, ".rela.got");
BFD_ASSERT (sgot != NULL && srela != NULL);
@@ -1618,11 +1617,12 @@ elf_m68k_finish_dynamic_symbol (output_bfd, info, h, sym)
+ (h->got_offset &~ 1));
/* If this is a -Bsymbolic link, and the symbol is defined
- locally, we just want to emit a RELATIVE reloc. The entry in
- the global offset table will already have been initialized in
- the relocate_section function. */
+ locally, we just want to emit a RELATIVE reloc. Likewise if
+ the symbol was forced to be local because of a version file.
+ The entry in the global offset table will already have been
+ initialized in the relocate_section function. */
if (info->shared
- && info->symbolic
+ && (info->symbolic || h->dynindx == -1)
&& (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
{
rela.r_info = ELF32_R_INFO (0, R_68K_RELATIVE);