diff options
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 5 | ||||
-rw-r--r-- | ld/ldelfgen.c | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 49e580d..2dad0b9 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2021-01-13 H.J. Lu <hongjiu.lu@intel.com> + + * ldelfgen.c (add_link_order_input_section): Check for ELF input + before accessing ELF section data. + 2021-01-13 Alan Modra <amodra@gmail.com> * Makefile.in: Regenerate. diff --git a/ld/ldelfgen.c b/ld/ldelfgen.c index 8014e22..47e7a2a 100644 --- a/ld/ldelfgen.c +++ b/ld/ldelfgen.c @@ -79,7 +79,8 @@ add_link_order_input_section (lang_input_section_type *is, os_info->isec[os_info->count].idx = os_info->count; os_info->count++; s = is->section; - if ((s->flags & SEC_LINKER_CREATED) == 0 + if (s->owner->xvec->flavour == bfd_target_elf_flavour + && (s->flags & SEC_LINKER_CREATED) == 0 && elf_section_data (s) != NULL && elf_linked_to_section (s) != NULL) os_info->ordered++; |