summaryrefslogtreecommitdiff
path: root/ld/plugin.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2011-01-05 14:25:25 +0000
committerH.J. Lu <hjl.tools@gmail.com>2011-01-05 14:25:25 +0000
commitbb5459e1cba5910d9fb58f7c4ca93bf48b5268a6 (patch)
tree0a68c5cf2749b9080753aff764bbb935180dd228 /ld/plugin.c
parent0dd74f848adf62f23f6c58a52fd2b205053b94d6 (diff)
downloadbinutils-redhat-bb5459e1cba5910d9fb58f7c4ca93bf48b5268a6.tar.gz
Check if a bfd is NULL before accessing its flags field.
2011-01-05 H.J. Lu <hongjiu.lu@intel.com> PR ld/12364 * plugin.c (get_symbols): Check if owner_sec->owner is NULL before accessing its flags field.
Diffstat (limited to 'ld/plugin.c')
-rw-r--r--ld/plugin.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ld/plugin.c b/ld/plugin.c
index e4943c2bdd..10314a4d48 100644
--- a/ld/plugin.c
+++ b/ld/plugin.c
@@ -511,7 +511,8 @@ get_symbols (const void *handle, int nsyms, struct ld_plugin_symbol *syms)
: LDPR_PREVAILING_DEF);
else if (is_ir_dummy_bfd (owner_sec->owner))
syms[n].resolution = LDPR_RESOLVED_IR;
- else if (owner_sec->owner->flags & DYNAMIC)
+ else if (owner_sec->owner != NULL
+ && (owner_sec->owner->flags & DYNAMIC) != 0)
syms[n].resolution = LDPR_RESOLVED_DYN;
else
syms[n].resolution = LDPR_RESOLVED_EXEC;