aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-i386.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1997-06-16 19:24:23 +0000
committerIan Lance Taylor <ian@airs.com>1997-06-16 19:24:23 +0000
commit90d7b9b9dd4830ba33c60a2a46482f24e8bc31d8 (patch)
tree3745ffab36cb08b9eadcd0e30b801d8fa6feb10c /bfd/elf32-i386.c
parent000befdfb4e4003aa2b28bdf1f0fcd7a1962b76a (diff)
downloadgdb-90d7b9b9dd4830ba33c60a2a46482f24e8bc31d8.zip
gdb-90d7b9b9dd4830ba33c60a2a46482f24e8bc31d8.tar.gz
gdb-90d7b9b9dd4830ba33c60a2a46482f24e8bc31d8.tar.bz2
* elf32-i386.c (elf_i386_relocate_section): When generating a
shared library, do the relocation if the input section is not allocated in memory.
Diffstat (limited to 'bfd/elf32-i386.c')
-rw-r--r--bfd/elf32-i386.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 91f0c50..4d5324a 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);
}
}