diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2013-01-17 23:36:07 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2013-01-17 23:36:07 +0000 |
commit | f95acfc6a38222b5f09c3d0c7a5827fba5e08a74 (patch) | |
tree | 3377d305dfc6df04d301e091c6abd4ce8a9c843c /bfd/elf32-i386.c | |
parent | 97862c2e554c073048cf7c480a2c2e9af3aa8465 (diff) | |
download | gdb-f95acfc6a38222b5f09c3d0c7a5827fba5e08a74.tar.gz |
Count size relocation as PC-relative relocation
bfd/
* elf32-i386.c (elf_i386_check_relocs): Count size relocation as
PC-relative relocation.
* elf64-x86-64.c (elf_x86_64_check_relocs): Count size relocation
as PC-relative relocation.
ld/testsuite/
* ld-size/size32-3-i386.d: New file.
* ld-size/size32-3-x32.d: Likewise.
* ld-size/size32-3-x86-64.d: Likewise.
* ld-size/size32-3.s: Likewise.
Diffstat (limited to 'bfd/elf32-i386.c')
-rw-r--r-- | bfd/elf32-i386.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 9c061baea70..f8ad1d1c1fc 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -1454,6 +1454,7 @@ elf_i386_check_relocs (bfd *abfd, struct elf_link_hash_entry *h; Elf_Internal_Sym *isym; const char *name; + bfd_boolean size_reloc; r_symndx = ELF32_R_SYM (rel->r_info); r_type = ELF32_R_TYPE (rel->r_info); @@ -1557,6 +1558,7 @@ elf_i386_check_relocs (bfd *abfd, break; case R_386_SIZE32: + size_reloc = TRUE; goto do_size; case R_386_TLS_IE_32: @@ -1706,6 +1708,7 @@ elf_i386_check_relocs (bfd *abfd, h->pointer_equality_needed = 1; } + size_reloc = FALSE; do_size: /* If we are creating a shared library, and this is a reloc against a global symbol, or a non PC relative reloc @@ -1803,7 +1806,8 @@ do_size: } p->count += 1; - if (r_type == R_386_PC32) + /* Count size relocation as PC-relative relocation. */ + if (r_type == R_386_PC32 || size_reloc) p->pc_count += 1; } break; |