From c99b813881319e6820bb60d837515b5df9837e2c Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 13 Jul 2004 18:56:38 +0000 Subject: [PATCH] (make_import_fixup): Use bfd_get_32 to correct for endian-ness of extracted addend. --- ld/ChangeLog | 5 +++++ ld/emultempl/pe.em | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index 92275b574c6..a1b679c1d58 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2004-07-13 Christof Petig + + * emultempl/pe.em (make_import_fixup): Use bfd_get_32 to correct + for endian-ness of extracted addend. + 2004-07-13 Danny Smith * pe-dll.c (auto_export): Filter on just the import prefix, diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index 4438afdee39..7c5b2d0d1ab 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.em @@ -842,17 +842,17 @@ static int make_import_fixup (arelent *rel, asection *s) { struct bfd_symbol *sym = *rel->sym_ptr_ptr; - int addend = 0; + char addend[4]; if (pe_dll_extra_pe_debug) printf ("arelent: %s@%#lx: add=%li\n", sym->name, (long) rel->address, (long) rel->addend); - if (! bfd_get_section_contents (s->owner, s, &addend, rel->address, sizeof (addend))) + if (! bfd_get_section_contents (s->owner, s, addend, rel->address, sizeof (addend))) einfo (_("%C: Cannot get section contents - auto-import exception\n"), s->owner, s, rel->address); - pe_create_import_fixup (rel, s, addend); + pe_create_import_fixup (rel, s, bfd_get_32 (s->owner, addend)); return 1; } -- 2.30.2