From 975961c337a97065135cb2874d8245b4bc656ce8 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 16 May 2010 06:29:08 +0000 Subject: [PATCH] Merge [2321] (fix for incorrect GOT offset) from trunk. svn path=/branches/yasm-1.0/; revision=2324 --- modules/objfmts/elf/elf-x86-x86.c | 13 +------------ modules/objfmts/elf/tests/elfso.hex | 2 +- 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 -- 2.40.0