diff options
author | Ian Lance Taylor <ian@airs.com> | 1996-01-29 20:01:29 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1996-01-29 20:01:29 +0000 |
commit | 53787b2316b0e9b4f166efc87f88748c46263096 (patch) | |
tree | 9e046118b9fb0ff1095502490b0956f948f3b784 /bfd/elf32-i386.c | |
parent | bdd2e7f1797de0511de1708366dcb146e806c329 (diff) | |
download | gdb-53787b2316b0e9b4f166efc87f88748c46263096.zip gdb-53787b2316b0e9b4f166efc87f88748c46263096.tar.gz gdb-53787b2316b0e9b4f166efc87f88748c46263096.tar.bz2 |
* elf32-i386.c (elf_i386_relocate_section): If -Bsymbolic, when
copying relocs into a shared object, treat a defined global symbol
as a local symbol.
* elf32-m68k.c (elf_m68k_relocate_section): Likewise.
* elf32-mips.c (mips_elf_relocate_section): Likewise.
* elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
Diffstat (limited to 'bfd/elf32-i386.c')
-rw-r--r-- | bfd/elf32-i386.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 82f0ccd..cb2a3dc 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -1,5 +1,5 @@ /* Intel 80386/80486-specific support for 32-bit ELF - Copyright 1993, 1994, 1995 Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1996 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -916,6 +916,9 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)) || (info->shared + && (! info->symbolic + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0) && (r_type == R_386_32 || r_type == R_386_PC32) && (input_section->flags & SEC_ALLOC) != 0)) @@ -1100,9 +1103,14 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, case R_386_PC32: if (info->shared && (input_section->flags & SEC_ALLOC) != 0 - && (r_type != R_386_PC32 || h != NULL)) + && (r_type != R_386_PC32 + || (h != NULL + && (! info->symbolic + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0)))) { Elf_Internal_Rel outrel; + boolean relocate; /* When generating a shared object, these relocations are copied into the output file to be resolved at run @@ -1134,15 +1142,23 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, if (r_type == R_386_PC32) { BFD_ASSERT (h != NULL && h->dynindx != -1); + relocate = false; outrel.r_info = ELF32_R_INFO (h->dynindx, R_386_PC32); } else { - if (h == NULL) - outrel.r_info = ELF32_R_INFO (0, R_386_RELATIVE); + if (h == NULL + || (info->symbolic + && (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) != 0)) + { + relocate = true; + outrel.r_info = ELF32_R_INFO (0, R_386_RELATIVE); + } else { BFD_ASSERT (h->dynindx != -1); + relocate = false; outrel.r_info = ELF32_R_INFO (h->dynindx, R_386_32); } } @@ -1157,7 +1173,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, not want to fiddle with the addend. Otherwise, we need to include the symbol value so that it becomes an addend for the dynamic reloc. */ - if (h != NULL) + if (! relocate) continue; } |