aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2005-07-27 07:01:30 +0000
committerJan Beulich <jbeulich@novell.com>2005-07-27 07:01:30 +0000
commita33d77bc5f66024ba9124be9642ddc0c06714139 (patch)
tree65b3e6840d76d426b10781ba95cd120eb6cd7314 /bfd
parentba825241e117100f7314d8583a173c770e42707f (diff)
downloadgdb-a33d77bc5f66024ba9124be9642ddc0c06714139.zip
gdb-a33d77bc5f66024ba9124be9642ddc0c06714139.tar.gz
gdb-a33d77bc5f66024ba9124be9642ddc0c06714139.tar.bz2
bfd/
2005-07-27 Jan Beulich <jbeulich@novell.com> * elf64-x86-64.c (R_X86_64_standard, R_X86_64_vt_offset): New. (elf64_x86_64_info_to_howto): Use them.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf64-x86-64.c11
2 files changed, 14 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index ff5c1bc..4286fdf 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2005-07-27 Jan Beulich <jbeulich@novell.com>
+
+ * elf64-x86-64.c (R_X86_64_standard, R_X86_64_vt_offset): New.
+ (elf64_x86_64_info_to_howto): Use them.
+
2005-07-27 Alan Modra <amodra@bigpond.net.au>
* elflink.c (_bfd_elf_merge_symbol): Skip weak redefinition
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index 0502e58..c100f3e 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -113,6 +113,13 @@ static reloc_howto_type x86_64_elf_howto_table[] =
bfd_elf_generic_reloc, "R_X86_64_GOTPC32",
FALSE, 0xffffffff, 0xffffffff, TRUE),
+ /* We have a gap in the reloc numbers here.
+ R_X86_64_standard counts the number up to this point, and
+ R_X86_64_vt_offset is the value to subtract from a reloc type of
+ R_X86_64_GNU_VT* to form an index into this table. */
+#define R_X86_64_standard (R_X86_64_GOTPC32 + 1)
+#define R_X86_64_vt_offset (R_X86_64_GNU_VTINHERIT - R_X86_64_standard)
+
/* GNU extension to record C++ vtable hierarchy. */
HOWTO (R_X86_64_GNU_VTINHERIT, 0, 4, 0, FALSE, 0, complain_overflow_dont,
NULL, "R_X86_64_GNU_VTINHERIT", FALSE, 0, 0, FALSE),
@@ -192,7 +199,7 @@ elf64_x86_64_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr,
if (r_type < (unsigned int) R_X86_64_GNU_VTINHERIT
|| r_type >= (unsigned int) R_X86_64_max)
{
- if (r_type > (unsigned int) R_X86_64_GOTPC32)
+ if (r_type >= (unsigned int) R_X86_64_standard)
{
(*_bfd_error_handler) (_("%B: invalid relocation type %d"),
abfd, (int) r_type);
@@ -201,7 +208,7 @@ elf64_x86_64_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr,
i = r_type;
}
else
- i = r_type - ((unsigned int) R_X86_64_GNU_VTINHERIT - R_X86_64_GOTPC32 - 1);
+ i = r_type - (unsigned int) R_X86_64_vt_offset;
cache_ptr->howto = &x86_64_elf_howto_table[i];
BFD_ASSERT (r_type == cache_ptr->howto->type);
}