From cc322803a5a55e75c91b5ad1fd210b79c4a49959 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 5 Jan 2011 14:25:26 +0000 Subject: [PATCH] Check if a bfd is NULL before accessing its flags field. 2011-01-05 H.J. Lu PR ld/12364 * plugin.c (get_symbols): Check if owner_sec->owner is NULL before accessing its flags field. --- ld/ChangeLog | 6 ++++++ ld/plugin.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index 8644b45d227..e9e88989f55 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,9 @@ +2011-01-05 H.J. Lu + + PR ld/12364 + * plugin.c (get_symbols): Check if owner_sec->owner is NULL + before accessing its flags field. + 2011-01-01 H.J. Lu * ldver.c (ldversion): Update copyright to 2011. diff --git a/ld/plugin.c b/ld/plugin.c index e4943c2bdd5..10314a4d485 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; -- 2.30.2