diff options
-rw-r--r-- | bfd/elf32-s390.c | 3 | ||||
-rw-r--r-- | bfd/elf64-s390.c | 3 | ||||
-rw-r--r-- | bfd/elf64-x86-64.c | 3 | ||||
-rw-r--r-- | bfd/elfnn-aarch64.c | 3 | ||||
-rw-r--r-- | bfd/elfnn-kvx.c | 3 | ||||
-rw-r--r-- | ld/ldwrite.c | 6 |
6 files changed, 11 insertions, 10 deletions
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c index 06d54e6..1a2ade0 100644 --- a/bfd/elf32-s390.c +++ b/bfd/elf32-s390.c @@ -3505,7 +3505,8 @@ elf_s390_finish_dynamic_symbol (bfd *output_bfd, RELATIVE reloc. The entry in the global offset table will already have been initialized in the relocate_section function. */ - BFD_ASSERT (h->def_regular || ELF_COMMON_DEF_P (h)); + if (!(h->def_regular || ELF_COMMON_DEF_P (h))) + return false; BFD_ASSERT((h->got.offset & 1) != 0); rela.r_info = ELF32_R_INFO (0, R_390_RELATIVE); rela.r_addend = (h->root.u.def.value diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c index bef90f6..ab9ec3f 100644 --- a/bfd/elf64-s390.c +++ b/bfd/elf64-s390.c @@ -3371,7 +3371,8 @@ elf_s390_finish_dynamic_symbol (bfd *output_bfd, RELATIVE reloc. The entry in the global offset table will already have been initialized in the relocate_section function. */ - BFD_ASSERT (h->def_regular || ELF_COMMON_DEF_P (h)); + if (!(h->def_regular || ELF_COMMON_DEF_P (h))) + return false; BFD_ASSERT((h->got.offset & 1) != 0); rela.r_info = ELF64_R_INFO (0, R_390_RELATIVE); rela.r_addend = (h->root.u.def.value diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index 6cc70a7..3300a20 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -4921,7 +4921,8 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd, else if (bfd_link_pic (info) && SYMBOL_REFERENCES_LOCAL_P (info, h)) { - BFD_ASSERT (SYMBOL_DEFINED_NON_SHARED_P (h)); + if (!SYMBOL_DEFINED_NON_SHARED_P (h)) + return false; BFD_ASSERT((h->got.offset & 1) != 0); if (info->enable_dt_relr) generate_dynamic_reloc = false; diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c index cf21f62..560983a 100644 --- a/bfd/elfnn-aarch64.c +++ b/bfd/elfnn-aarch64.c @@ -9739,7 +9739,8 @@ elfNN_aarch64_finish_dynamic_symbol (bfd *output_bfd, } else if (bfd_link_pic (info) && SYMBOL_REFERENCES_LOCAL (info, h)) { - BFD_ASSERT (h->def_regular || ELF_COMMON_DEF_P (h)); + if (!(h->def_regular || ELF_COMMON_DEF_P (h))) + return false; BFD_ASSERT ((h->got.offset & 1) != 0); rela.r_info = ELFNN_R_INFO (0, AARCH64_R (RELATIVE)); rela.r_addend = (h->root.u.def.value diff --git a/bfd/elfnn-kvx.c b/bfd/elfnn-kvx.c index 00446c9..ae5ed6b 100644 --- a/bfd/elfnn-kvx.c +++ b/bfd/elfnn-kvx.c @@ -4479,7 +4479,8 @@ elfNN_kvx_finish_dynamic_symbol (bfd *output_bfd, if (bfd_link_pic (info) && SYMBOL_REFERENCES_LOCAL (info, h)) { - BFD_ASSERT (h->def_regular); + if (!h->def_regular) + return false; /* in case of PLT related GOT entry, it is not clear who is supposed to set the LSB of GOT entry... diff --git a/ld/ldwrite.c b/ld/ldwrite.c index 46fb33c..8ce4297 100644 --- a/ld/ldwrite.c +++ b/ld/ldwrite.c @@ -549,13 +549,9 @@ ldwrite (void) split_sections (link_info.output_bfd, &link_info); if (!bfd_final_link (link_info.output_bfd, &link_info)) { - /* If there was an error recorded, print it out. Otherwise assume - an appropriate error message like unknown symbol was printed - out. */ - if (bfd_get_error () != bfd_error_no_error) einfo (_("%F%P: final link failed: %E\n")); else - xexit (1); + einfo (_("%F%P: final link failed\n")); } } |