aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>1998-11-11 23:11:38 +0000
committerDJ Delorie <dj@redhat.com>1998-11-11 23:11:38 +0000
commitb138a74d470630ad54c22a9902b8e529cd03b5ea (patch)
tree82e592ee70b3362c1b7582eeedc450d76cf4d7ba /ld
parent847b31bdab68ce9acc0ca13dd66cf131f5baa6fe (diff)
downloadgdb-b138a74d470630ad54c22a9902b8e529cd03b5ea.zip
gdb-b138a74d470630ad54c22a9902b8e529cd03b5ea.tar.gz
gdb-b138a74d470630ad54c22a9902b8e529cd03b5ea.tar.bz2
* pe-dll.c (generate_reloc): don't output PE relocs for sections
that won't be loaded.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/pe-dll.c21
2 files changed, 25 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index e9a3d5b..e45a570 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+Wed Nov 11 18:10:15 1998 DJ Delorie <dj@cygnus.com>
+
+ * pe-dll.c (generate_reloc): don't output PE relocs for sections
+ that won't be loaded.
+
Wed Nov 11 13:44:54 1998 DJ Delorie <dj@cygnus.com>
* pe-dll.c (fill_edata): don't strip underscores
diff --git a/ld/pe-dll.c b/ld/pe-dll.c
index aaf1cb1..51520c4 100644
--- a/ld/pe-dll.c
+++ b/ld/pe-dll.c
@@ -617,6 +617,24 @@ generate_reloc (abfd, info)
asymbol **symbols;
int nsyms, symsize;
+ /* if it's not loaded, we don't need to relocate it this way */
+ if (!(s->output_section->flags & SEC_LOAD))
+ continue;
+
+ /* I don't know why there would be a reloc for these, but I've
+ seen it happen - DJ */
+ if (s->output_section == &bfd_abs_section)
+ continue;
+
+ if (s->output_section->vma == 0)
+ {
+ /* Huh? Shouldn't happen, but punt if it does */
+ einfo ("DJ: zero vma section reloc detected: `%s' #%d f=%d\n",
+ s->output_section->name, s->output_section->index,
+ s->output_section->flags);
+ continue;
+ }
+
symsize = bfd_get_symtab_upper_bound (b);
symbols = (asymbol **) xmalloc (symsize);
nsyms = bfd_canonicalize_symtab (b, symbols);
@@ -627,7 +645,8 @@ generate_reloc (abfd, info)
for (i = 0; i < nrelocs; i++)
{
- if (!relocs[i]->howto->pc_relative)
+ if (!relocs[i]->howto->pc_relative
+ && relocs[i]->howto->type != R_IMAGEBASE)
{
switch (relocs[i]->howto->bitsize)
{