From: Ian Lance Taylor Date: Mon, 16 Jun 1997 19:24:23 +0000 (+0000) Subject: * elf32-i386.c (elf_i386_relocate_section): When generating a X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=90d7b9b9dd4830ba33c60a2a46482f24e8bc31d8;p=binutils-gdb.git * elf32-i386.c (elf_i386_relocate_section): When generating a shared library, do the relocation if the input section is not allocated in memory. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index f84f7425f2a..8c429e6cd81 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -12,6 +12,10 @@ Mon Jun 16 14:42:14 1997 H.J. Lu Mon Jun 16 12:31:29 1997 Ian Lance Taylor + * elf32-i386.c (elf_i386_relocate_section): When generating a + shared library, do the relocation if the input section is not + allocated in memory. + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Call elf_link_assign_sym_version before elf_adjust_dynamic_symbol. (elf_fix_symbol_flags): New static function, broken out of diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 91f0c5015e2..4d5324a0a88 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -1187,7 +1187,8 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) && (r_type == R_386_32 - || r_type == R_386_PC32))) + || r_type == R_386_PC32) + && (input_section->flags & SEC_ALLOC) != 0)) { /* In these cases, we don't need the relocation value. We check specially because in some @@ -1439,7 +1440,10 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, else if (r_type == R_386_PC32) { BFD_ASSERT (h != NULL && h->dynindx != -1); - relocate = false; + if ((input_section->flags & SEC_ALLOC) != 0) + relocate = false; + else + relocate = true; outrel.r_info = ELF32_R_INFO (h->dynindx, R_386_PC32); } else @@ -1457,7 +1461,10 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, else { BFD_ASSERT (h->dynindx != -1); - relocate = false; + if ((input_section->flags & SEC_ALLOC) != 0) + relocate = false; + else + relocate = true; outrel.r_info = ELF32_R_INFO (h->dynindx, R_386_32); } }