aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
authorCharles Wilson <cygwin@cwilson.fastmail.fm>2001-09-12 15:58:10 +0000
committerCharles Wilson <cygwin@cwilson.fastmail.fm>2001-09-12 15:58:10 +0000
commit0d888aac30824dd7fc2481efefd0a0f4808812e8 (patch)
treedcc3c9663cffcbe49a873a805d2391c9c7f990bf /ld/emultempl
parentcedacdc05a9872309cd078e32ce6565266bc9065 (diff)
downloadgdb-0d888aac30824dd7fc2481efefd0a0f4808812e8.zip
gdb-0d888aac30824dd7fc2481efefd0a0f4808812e8.tar.gz
gdb-0d888aac30824dd7fc2481efefd0a0f4808812e8.tar.bz2
2001-09-12 Paul Sokolovsky <Paul.Sokolovsky@technologist.com>
* emultempl/pe.em(make_import_fixup): change signature to take asection as well as arelec; we need this for proper error reporting. Only call pe_create_import_fixup() if there is no attempt to add a constant addend to the reloc; otherwise, report error condition. * pe-dll.c(pe_walk_relocs_of_symbol): change signature, since final argument is a pointer to make_import_fixup(). Change call to cb() to match make_import_fixup() signature. (make_import_fixup_mark): make buffer_len unsigned. * pe-dll.h: change signature of pe_walk_relocs_of_symbol. 2001-09-12 Charles Wilson <cwilson@ece.gatech.edu> * ld.texinfo: add verbose documentation for auto-import direct-addressing workaround, to compliment the terse error message.
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/pe.em28
1 files changed, 22 insertions, 6 deletions
diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em
index baca171..093c081 100644
--- a/ld/emultempl/pe.em
+++ b/ld/emultempl/pe.em
@@ -127,7 +127,7 @@ static void set_pe_stack_heap PARAMS ((char *, char *));
static boolean pe_undef_cdecl_match
PARAMS ((struct bfd_link_hash_entry *, PTR));
static void pe_fixup_stdcalls PARAMS ((void));
-static int make_import_fixup PARAMS ((arelent *));
+static int make_import_fixup PARAMS ((arelent *, asection *));
static void pe_find_data_imports PARAMS ((void));
#endif
@@ -845,20 +845,36 @@ pe_fixup_stdcalls ()
}
static int
-make_import_fixup (rel)
+make_import_fixup (rel, s)
arelent *rel;
+ asection *s;
{
struct symbol_cache_entry *sym = *rel->sym_ptr_ptr;
-/*
- bfd *b;
-*/
if (pe_dll_extra_pe_debug)
{
printf ("arelent: %s@%#x: add=%li\n", sym->name,
(int) rel->address, rel->addend);
}
- pe_create_import_fixup (rel);
+
+ {
+ int addend = 0;
+ 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);
+ }
+
+ if (addend == 0)
+ pe_create_import_fixup (rel);
+ else
+ {
+ einfo (_("%C: variable '%T' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.\n"),
+ s->owner, s, rel->address, sym->name);
+ einfo ("%X");
+ }
+ }
+
return 1;
}