summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Johnson <peter@tortall.net>2010-05-16 06:29:08 +0000
committerPeter Johnson <peter@tortall.net>2010-05-16 06:29:08 +0000
commit975961c337a97065135cb2874d8245b4bc656ce8 (patch)
treed99b3196303762b7afe6b40ea5c8dea533e4af91
parent21889fc92df46a9d39a82d1f428ed29c16124e4f (diff)
downloadyasm-975961c337a97065135cb2874d8245b4bc656ce8.tar.gz
Merge [2321] (fix for incorrect GOT offset) from trunk.
svn path=/branches/yasm-1.0/; revision=2324
-rw-r--r--modules/objfmts/elf/elf-x86-x86.c13
-rw-r--r--modules/objfmts/elf/tests/elfso.hex2
2 files changed, 2 insertions, 13 deletions
diff --git a/modules/objfmts/elf/elf-x86-x86.c b/modules/objfmts/elf/elf-x86-x86.c
index d2fa6d1e..3c5157fe 100644
--- a/modules/objfmts/elf/elf-x86-x86.c
+++ b/modules/objfmts/elf/elf-x86-x86.c
@@ -140,18 +140,7 @@ elf_x86_x86_handle_reloc_addend(yasm_intnum *intn,
elf_reloc_entry *reloc,
unsigned long offset)
{
- int is_GOT = reloc->is_GOT_sym;
-
- if (reloc->wrt) {
- const elf_machine_ssym *ssym = (elf_machine_ssym *)
- yasm_symrec_get_data(reloc->wrt, &elf_ssym_symrec_data);
- if (!ssym || reloc->valsize != ssym->size)
- yasm_internal_error(N_("Unsupported WRT"));
- if (ssym->reloc == R_386_GOTPC)
- is_GOT = 1;
- }
-
- if (is_GOT && reloc->valsize == 32 && offset != 0)
+ if (!reloc->wrt && reloc->is_GOT_sym && reloc->valsize == 32 && offset != 0)
{
yasm_intnum *off_intn = yasm_intnum_create_uint(offset);
yasm_intnum_calc(intn, YASM_EXPR_ADD, off_intn);
diff --git a/modules/objfmts/elf/tests/elfso.hex b/modules/objfmts/elf/tests/elfso.hex
index 94a50cbd..206cce9c 100644
--- a/modules/objfmts/elf/tests/elfso.hex
+++ b/modules/objfmts/elf/tests/elfso.hex
@@ -88,7 +88,7 @@ e8
5b
81
c3
-05
+03
00
00
00