mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-18 00:32:30 +08:00
bfd/
* elf.c (_bfd_elf_make_section_from_shdr): Don't set SEC_EXCLUDE for SHT_GROUP sections. ld/ * ldlang.c (lang_add_section): Set SEC_EXCLUDE for SEC_GROUP sections when doing a final link. Clear SEC_EXCLUDE when doing a relocable link, except for SEC_DEBUGGING sections. * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Use the same condition here to drop SEC_EXCLUDE orphan sections.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2004-05-26 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
* elf.c (_bfd_elf_make_section_from_shdr): Don't set SEC_EXCLUDE
|
||||||
|
for SHT_GROUP sections.
|
||||||
|
|
||||||
2004-05-25 Alan Modra <amodra@bigpond.net.au>
|
2004-05-25 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
* elflink.c (elf_link_add_object_symbols): Don't set up merge
|
* elflink.c (elf_link_add_object_symbols): Don't set up merge
|
||||||
|
@ -677,7 +677,7 @@ _bfd_elf_make_section_from_shdr (bfd *abfd,
|
|||||||
if (hdr->sh_type != SHT_NOBITS)
|
if (hdr->sh_type != SHT_NOBITS)
|
||||||
flags |= SEC_HAS_CONTENTS;
|
flags |= SEC_HAS_CONTENTS;
|
||||||
if (hdr->sh_type == SHT_GROUP)
|
if (hdr->sh_type == SHT_GROUP)
|
||||||
flags |= SEC_GROUP | SEC_EXCLUDE;
|
flags |= SEC_GROUP;
|
||||||
if ((hdr->sh_flags & SHF_ALLOC) != 0)
|
if ((hdr->sh_flags & SHF_ALLOC) != 0)
|
||||||
{
|
{
|
||||||
flags |= SEC_ALLOC;
|
flags |= SEC_ALLOC;
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
2004-05-26 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
* ldlang.c (lang_add_section): Set SEC_EXCLUDE for SEC_GROUP
|
||||||
|
sections when doing a final link. Clear SEC_EXCLUDE when doing
|
||||||
|
a relocable link, except for SEC_DEBUGGING sections.
|
||||||
|
* emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Use the
|
||||||
|
same condition here to drop SEC_EXCLUDE orphan sections.
|
||||||
|
|
||||||
2004-05-25 Alan Modra <amodra@bigpond.net.au>
|
2004-05-25 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
* ldlang.c (lang_process): Call bfd_merge_sections later, and
|
* ldlang.c (lang_process): Call bfd_merge_sections later, and
|
||||||
|
@ -1182,7 +1182,9 @@ gld${EMULATION_NAME}_place_orphan (lang_input_statement_type *file, asection *s)
|
|||||||
#define HAVE_SECTION(hold, name) \
|
#define HAVE_SECTION(hold, name) \
|
||||||
(hold.os != NULL || (hold.os = lang_output_section_find (name)) != NULL)
|
(hold.os != NULL || (hold.os = lang_output_section_find (name)) != NULL)
|
||||||
|
|
||||||
if ((s->flags & SEC_EXCLUDE) != 0 && !link_info.relocatable)
|
if (((s->flags & (SEC_EXCLUDE | SEC_GROUP)) != 0 && !link_info.relocatable)
|
||||||
|
|| ((s->flags & (SEC_EXCLUDE | SEC_DEBUGGING))
|
||||||
|
== (SEC_EXCLUDE | SEC_DEBUGGING)))
|
||||||
{
|
{
|
||||||
if (s->output_section == NULL)
|
if (s->output_section == NULL)
|
||||||
s->output_section = bfd_abs_section_ptr;
|
s->output_section = bfd_abs_section_ptr;
|
||||||
|
25
ld/ldlang.c
25
ld/ldlang.c
@ -1096,11 +1096,26 @@ lang_add_section (lang_statement_list_type *ptr,
|
|||||||
|
|
||||||
discard = FALSE;
|
discard = FALSE;
|
||||||
|
|
||||||
/* Discard sections marked with SEC_EXCLUDE if we are doing a final
|
if (link_info.relocatable)
|
||||||
link. Discard debugging sections marked with SEC_EXCLUDE on a
|
{
|
||||||
relocatable link too. */
|
/* SEC_EXCLUDE is ignored when doing a relocatable link,
|
||||||
if ((flags & SEC_EXCLUDE) != 0
|
except in the special case of debug info. (See bfd/stabs.c) */
|
||||||
&& ((flags & SEC_DEBUGGING) != 0 || !link_info.relocatable))
|
if ((flags & SEC_DEBUGGING) == 0)
|
||||||
|
flags &= ~SEC_EXCLUDE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* SEC_GROUP sections should be dropped on a final link. */
|
||||||
|
if ((flags & SEC_GROUP) != 0)
|
||||||
|
flags |= SEC_EXCLUDE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Write SEC_EXCLUDE flag back, to simplify later linker code. */
|
||||||
|
if (section->owner != NULL)
|
||||||
|
bfd_set_section_flags (section->owner, section, flags);
|
||||||
|
|
||||||
|
/* Discard sections marked with SEC_EXCLUDE. */
|
||||||
|
if ((flags & SEC_EXCLUDE) != 0)
|
||||||
discard = TRUE;
|
discard = TRUE;
|
||||||
|
|
||||||
/* Discard input sections which are assigned to a section named
|
/* Discard input sections which are assigned to a section named
|
||||||
|
Reference in New Issue
Block a user