mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-23 01:53:38 +08:00
Re: elf_backend_finish_dynamic_symbol returning false
I didn't examine ld testsuite logs properly after cf95b909e2
.
Replacing one of the "return false" with BFD_ASSERT in
finish_dynamic_symbol was wrong as it causes segmentation faults on
testcases expected to fail. Revert those changes and instead make
a bfd_final_link failure noisy.
This commit is contained in:
parent
d88a48558d
commit
313f04b6ed
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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...
|
||||
|
@ -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"));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user