mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-26 22:07:58 +08:00
2005-12-07 H.J. Lu <hongjiu.lu@intel.com>
Andreas Schwab <schwab@suse.de> PR binutils/1991 * elf.c (assign_section_numbers): Always use the output section when setting up sh_link for SHF_LINK_ORDER.
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
2005-12-07 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
Andreas Schwab <schwab@suse.de>
|
||||||
|
|
||||||
|
PR binutils/1991
|
||||||
|
* elf.c (assign_section_numbers): Always use the output section
|
||||||
|
when setting up sh_link for SHF_LINK_ORDER.
|
||||||
|
|
||||||
2005-12-07 Thiemo Seufer <ths@networkno.de>
|
2005-12-07 Thiemo Seufer <ths@networkno.de>
|
||||||
H.J. Lu <hongjiu.lu@intel.com>
|
H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
21
bfd/elf.c
21
bfd/elf.c
@ -3053,10 +3053,10 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info)
|
|||||||
s = elf_linked_to_section (sec);
|
s = elf_linked_to_section (sec);
|
||||||
if (s)
|
if (s)
|
||||||
{
|
{
|
||||||
|
/* elf_linked_to_section points to the input section. */
|
||||||
if (link_info != NULL)
|
if (link_info != NULL)
|
||||||
{
|
{
|
||||||
/* For linker, elf_linked_to_section points to the
|
/* Check discarded linkonce section. */
|
||||||
input section. */
|
|
||||||
if (elf_discarded_section (s))
|
if (elf_discarded_section (s))
|
||||||
{
|
{
|
||||||
asection *kept;
|
asection *kept;
|
||||||
@ -3074,9 +3074,26 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info)
|
|||||||
}
|
}
|
||||||
s = kept;
|
s = kept;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (link_info != NULL)
|
||||||
|
{
|
||||||
|
/* Handle linker. */
|
||||||
s = s->output_section;
|
s = s->output_section;
|
||||||
BFD_ASSERT (s != NULL);
|
BFD_ASSERT (s != NULL);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Handle objcopy. */
|
||||||
|
if (s->output_section == NULL)
|
||||||
|
{
|
||||||
|
(*_bfd_error_handler)
|
||||||
|
(_("%B: sh_link of section `%A' points to removed section `%A' of `%B'"),
|
||||||
|
abfd, d->this_hdr.bfd_section, s, s->owner);
|
||||||
|
bfd_set_error (bfd_error_bad_value);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
s = s->output_section;
|
||||||
|
}
|
||||||
d->this_hdr.sh_link = elf_section_data (s)->this_idx;
|
d->this_hdr.sh_link = elf_section_data (s)->this_idx;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user