Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Unified Diff: binutils/ld/pe-dll.c

Issue 3018030: [binutils] Bump binutils to 2.20.1 (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/nacl-toolchain.git
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « binutils/ld/ldlex-wrapper.c ('k') | binutils/ld/po/POTFILES.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: binutils/ld/pe-dll.c
diff --git a/binutils/ld/pe-dll.c b/binutils/ld/pe-dll.c
index f615b2d2bfccc209346fefbcef8d20e9f2856516..54021b64546e6d200f79320b76f36fa4ad8d2e3f 100644
--- a/binutils/ld/pe-dll.c
+++ b/binutils/ld/pe-dll.c
@@ -1348,10 +1348,29 @@ generate_reloc (bfd *abfd, struct bfd_link_info *info)
if (sym->flags == BSF_WEAK)
{
struct bfd_link_hash_entry *blhe
- = bfd_link_hash_lookup (info->hash, sym->name,
+ = bfd_wrapped_link_hash_lookup (abfd, info, sym->name,
FALSE, FALSE, FALSE);
- if (!blhe || blhe->type != bfd_link_hash_defined)
- continue;
+ if (blhe && blhe->type == bfd_link_hash_undefweak)
+ {
+ /* Check aux sym and see if it is defined or not. */
+ struct coff_link_hash_entry *h, *h2;
+ h = (struct coff_link_hash_entry *)blhe;
+ if (h->symbol_class != C_NT_WEAK || h->numaux != 1)
+ continue;
+ h2 = h->auxbfd->tdata.coff_obj_data->sym_hashes
+ [h->aux->x_sym.x_tagndx.l];
+ /* We don't want a base reloc if the aux sym is not
+ found, undefined, or if it is the constant ABS
+ zero default value. (We broaden that slightly by
+ not testing the value, just the section; there's
+ no reason we'd want a reference to any absolute
+ address to get relocated during rebasing). */
+ if (!h2 || h2->root.type == bfd_link_hash_undefined
+ || h2->root.u.def.section == &bfd_abs_section)
+ continue;
+ }
+ else if (!blhe || blhe->type != bfd_link_hash_defined)
+ continue;
}
sym_vma = (relocs[i]->addend
« no previous file with comments | « binutils/ld/ldlex-wrapper.c ('k') | binutils/ld/po/POTFILES.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698