bfd/
* elf-bfd.h (_bfd_generic_match_sections_by_type): Don't define. * libbfd-in.h (_bfd_generic_match_sections_by_type): Delete. * libbfd.c (_bfd_generic_match_sections_by_type): Delete. * targets.c (bfd_match_sections_by_type): Don't define. (BFD_JUMP_TABLE_LINK): Remove _bfd_generic_match_sections_by_type. * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise. * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Likewise. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. ld/ * ldlang.c (lang_output_section_find_by_flags): Add match_type param. Run two passes, first using match_type, second without. * ldlang.h (lang_match_sec_type_func): New typedef. (lang_output_section_find_by_flags): Update prototype. bfd_match_sections_by_type and lang_output_section_find_by_flags. * emultempl/pe.em (place_orphan): Likewise.
This commit is contained in:
parent
be5291325d
commit
390fbbf109
14 changed files with 67 additions and 80 deletions
|
@ -1,3 +1,15 @@
|
||||||
|
2005-11-24 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
* elf-bfd.h (_bfd_generic_match_sections_by_type): Don't define.
|
||||||
|
* libbfd-in.h (_bfd_generic_match_sections_by_type): Delete.
|
||||||
|
* libbfd.c (_bfd_generic_match_sections_by_type): Delete.
|
||||||
|
* targets.c (bfd_match_sections_by_type): Don't define.
|
||||||
|
(BFD_JUMP_TABLE_LINK): Remove _bfd_generic_match_sections_by_type.
|
||||||
|
* coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise.
|
||||||
|
* coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Likewise.
|
||||||
|
* bfd-in2.h: Regenerate.
|
||||||
|
* libbfd.h: Regenerate.
|
||||||
|
|
||||||
2005-11-23 Daniel Jacobowitz <dan@codesourcery.com>
|
2005-11-23 Daniel Jacobowitz <dan@codesourcery.com>
|
||||||
Thiemo Seufer <ths@networkno.de>
|
Thiemo Seufer <ths@networkno.de>
|
||||||
|
|
||||||
|
|
|
@ -4945,7 +4945,6 @@ typedef struct bfd_target
|
||||||
NAME##_bfd_link_split_section, \
|
NAME##_bfd_link_split_section, \
|
||||||
NAME##_bfd_gc_sections, \
|
NAME##_bfd_gc_sections, \
|
||||||
NAME##_bfd_merge_sections, \
|
NAME##_bfd_merge_sections, \
|
||||||
_bfd_generic_match_sections_by_type, \
|
|
||||||
NAME##_bfd_is_group_section, \
|
NAME##_bfd_is_group_section, \
|
||||||
NAME##_bfd_discard_group, \
|
NAME##_bfd_discard_group, \
|
||||||
NAME##_section_already_linked \
|
NAME##_section_already_linked \
|
||||||
|
@ -4985,12 +4984,6 @@ typedef struct bfd_target
|
||||||
/* Attempt to merge SEC_MERGE sections. */
|
/* Attempt to merge SEC_MERGE sections. */
|
||||||
bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
|
bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
|
||||||
|
|
||||||
#define bfd_match_sections_by_type(abfd, asec, bbfd, bsec) \
|
|
||||||
BFD_SEND (abfd, _bfd_match_sections_by_type, (abfd, asec, bbfd, bsec))
|
|
||||||
/* Return TRUE if 2 section types are compatible. */
|
|
||||||
bfd_boolean (*_bfd_match_sections_by_type)
|
|
||||||
(bfd *, const asection *, bfd *, const asection *);
|
|
||||||
|
|
||||||
/* Is this section a member of a group? */
|
/* Is this section a member of a group? */
|
||||||
bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
|
bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
|
||||||
|
|
||||||
|
|
|
@ -4196,7 +4196,6 @@ const bfd_target rs6000coff_vec =
|
||||||
_bfd_generic_link_split_section,
|
_bfd_generic_link_split_section,
|
||||||
bfd_generic_gc_sections,
|
bfd_generic_gc_sections,
|
||||||
bfd_generic_merge_sections,
|
bfd_generic_merge_sections,
|
||||||
_bfd_generic_match_sections_by_type,
|
|
||||||
bfd_generic_is_group_section,
|
bfd_generic_is_group_section,
|
||||||
bfd_generic_discard_group,
|
bfd_generic_discard_group,
|
||||||
_bfd_generic_section_already_linked,
|
_bfd_generic_section_already_linked,
|
||||||
|
@ -4447,7 +4446,6 @@ const bfd_target pmac_xcoff_vec =
|
||||||
_bfd_generic_link_split_section,
|
_bfd_generic_link_split_section,
|
||||||
bfd_generic_gc_sections,
|
bfd_generic_gc_sections,
|
||||||
bfd_generic_merge_sections,
|
bfd_generic_merge_sections,
|
||||||
_bfd_generic_match_sections_by_type,
|
|
||||||
bfd_generic_is_group_section,
|
bfd_generic_is_group_section,
|
||||||
bfd_generic_discard_group,
|
bfd_generic_discard_group,
|
||||||
_bfd_generic_section_already_linked,
|
_bfd_generic_section_already_linked,
|
||||||
|
|
|
@ -2743,7 +2743,6 @@ const bfd_target rs6000coff64_vec =
|
||||||
_bfd_generic_link_split_section,
|
_bfd_generic_link_split_section,
|
||||||
bfd_generic_gc_sections,
|
bfd_generic_gc_sections,
|
||||||
bfd_generic_merge_sections,
|
bfd_generic_merge_sections,
|
||||||
_bfd_generic_match_sections_by_type,
|
|
||||||
bfd_generic_is_group_section,
|
bfd_generic_is_group_section,
|
||||||
bfd_generic_discard_group,
|
bfd_generic_discard_group,
|
||||||
_bfd_generic_section_already_linked,
|
_bfd_generic_section_already_linked,
|
||||||
|
@ -2995,7 +2994,6 @@ const bfd_target aix5coff64_vec =
|
||||||
_bfd_generic_link_split_section,
|
_bfd_generic_link_split_section,
|
||||||
bfd_generic_gc_sections,
|
bfd_generic_gc_sections,
|
||||||
bfd_generic_merge_sections,
|
bfd_generic_merge_sections,
|
||||||
_bfd_generic_match_sections_by_type,
|
|
||||||
bfd_generic_is_group_section,
|
bfd_generic_is_group_section,
|
||||||
bfd_generic_discard_group,
|
bfd_generic_discard_group,
|
||||||
_bfd_generic_section_already_linked,
|
_bfd_generic_section_already_linked,
|
||||||
|
|
|
@ -1476,8 +1476,6 @@ extern bfd_boolean _bfd_elf_merge_sections
|
||||||
(bfd *, struct bfd_link_info *);
|
(bfd *, struct bfd_link_info *);
|
||||||
extern bfd_boolean _bfd_elf_match_sections_by_type
|
extern bfd_boolean _bfd_elf_match_sections_by_type
|
||||||
(bfd *, const asection *, bfd *, const asection *);
|
(bfd *, const asection *, bfd *, const asection *);
|
||||||
#define _bfd_generic_match_sections_by_type \
|
|
||||||
_bfd_elf_match_sections_by_type
|
|
||||||
extern bfd_boolean bfd_elf_is_group_section
|
extern bfd_boolean bfd_elf_is_group_section
|
||||||
(bfd *, const struct bfd_section *);
|
(bfd *, const struct bfd_section *);
|
||||||
extern void _bfd_elf_section_already_linked
|
extern void _bfd_elf_section_already_linked
|
||||||
|
|
|
@ -402,8 +402,6 @@ extern bfd_boolean _bfd_generic_set_section_contents
|
||||||
((bfd_boolean (*) (bfd *, struct bfd_section *)) bfd_false)
|
((bfd_boolean (*) (bfd *, struct bfd_section *)) bfd_false)
|
||||||
#define _bfd_nolink_section_already_linked \
|
#define _bfd_nolink_section_already_linked \
|
||||||
((void (*) (bfd *, struct bfd_section *)) bfd_void)
|
((void (*) (bfd *, struct bfd_section *)) bfd_void)
|
||||||
extern bfd_boolean _bfd_generic_match_sections_by_type
|
|
||||||
(bfd *, const asection *, bfd *, const asection *);
|
|
||||||
|
|
||||||
/* Routines to use for BFD_JUMP_TABLE_DYNAMIC for targets which do not
|
/* Routines to use for BFD_JUMP_TABLE_DYNAMIC for targets which do not
|
||||||
have dynamic symbols or relocs. Use BFD_JUMP_TABLE_DYNAMIC
|
have dynamic symbols or relocs. Use BFD_JUMP_TABLE_DYNAMIC
|
||||||
|
|
|
@ -1034,15 +1034,6 @@ _bfd_generic_find_line (bfd *abfd ATTRIBUTE_UNUSED,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bfd_boolean
|
|
||||||
_bfd_generic_match_sections_by_type (bfd *abfd ATTRIBUTE_UNUSED,
|
|
||||||
const asection *asec ATTRIBUTE_UNUSED,
|
|
||||||
bfd *bbfd ATTRIBUTE_UNUSED,
|
|
||||||
const asection *bsec ATTRIBUTE_UNUSED)
|
|
||||||
{
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
bfd_boolean
|
bfd_boolean
|
||||||
_bfd_generic_init_private_section_data (bfd *ibfd ATTRIBUTE_UNUSED,
|
_bfd_generic_init_private_section_data (bfd *ibfd ATTRIBUTE_UNUSED,
|
||||||
asection *isec ATTRIBUTE_UNUSED,
|
asection *isec ATTRIBUTE_UNUSED,
|
||||||
|
|
|
@ -407,8 +407,6 @@ extern bfd_boolean _bfd_generic_set_section_contents
|
||||||
((bfd_boolean (*) (bfd *, struct bfd_section *)) bfd_false)
|
((bfd_boolean (*) (bfd *, struct bfd_section *)) bfd_false)
|
||||||
#define _bfd_nolink_section_already_linked \
|
#define _bfd_nolink_section_already_linked \
|
||||||
((void (*) (bfd *, struct bfd_section *)) bfd_void)
|
((void (*) (bfd *, struct bfd_section *)) bfd_void)
|
||||||
extern bfd_boolean _bfd_generic_match_sections_by_type
|
|
||||||
(bfd *, const asection *, bfd *, const asection *);
|
|
||||||
|
|
||||||
/* Routines to use for BFD_JUMP_TABLE_DYNAMIC for targets which do not
|
/* Routines to use for BFD_JUMP_TABLE_DYNAMIC for targets which do not
|
||||||
have dynamic symbols or relocs. Use BFD_JUMP_TABLE_DYNAMIC
|
have dynamic symbols or relocs. Use BFD_JUMP_TABLE_DYNAMIC
|
||||||
|
|
|
@ -434,7 +434,6 @@ BFD_JUMP_TABLE macros.
|
||||||
. NAME##_bfd_link_split_section, \
|
. NAME##_bfd_link_split_section, \
|
||||||
. NAME##_bfd_gc_sections, \
|
. NAME##_bfd_gc_sections, \
|
||||||
. NAME##_bfd_merge_sections, \
|
. NAME##_bfd_merge_sections, \
|
||||||
. _bfd_generic_match_sections_by_type, \
|
|
||||||
. NAME##_bfd_is_group_section, \
|
. NAME##_bfd_is_group_section, \
|
||||||
. NAME##_bfd_discard_group, \
|
. NAME##_bfd_discard_group, \
|
||||||
. NAME##_section_already_linked \
|
. NAME##_section_already_linked \
|
||||||
|
@ -474,12 +473,6 @@ BFD_JUMP_TABLE macros.
|
||||||
. {* Attempt to merge SEC_MERGE sections. *}
|
. {* Attempt to merge SEC_MERGE sections. *}
|
||||||
. bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
|
. bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
|
||||||
.
|
.
|
||||||
.#define bfd_match_sections_by_type(abfd, asec, bbfd, bsec) \
|
|
||||||
. BFD_SEND (abfd, _bfd_match_sections_by_type, (abfd, asec, bbfd, bsec))
|
|
||||||
. {* Return TRUE if 2 section types are compatible. *}
|
|
||||||
. bfd_boolean (*_bfd_match_sections_by_type)
|
|
||||||
. (bfd *, const asection *, bfd *, const asection *);
|
|
||||||
.
|
|
||||||
. {* Is this section a member of a group? *}
|
. {* Is this section a member of a group? *}
|
||||||
. bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
|
. bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
|
||||||
.
|
.
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
|
2005-11-24 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
|
* ldlang.c (lang_output_section_find_by_flags): Add match_type param.
|
||||||
|
Run two passes, first using match_type, second without.
|
||||||
|
* ldlang.h (lang_match_sec_type_func): New typedef.
|
||||||
|
(lang_output_section_find_by_flags): Update prototype.
|
||||||
|
bfd_match_sections_by_type and lang_output_section_find_by_flags.
|
||||||
|
* emultempl/pe.em (place_orphan): Likewise.
|
||||||
|
|
||||||
2005-11-24 Alan Modra <amodra@bigpond.net.au>
|
2005-11-24 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
* ldlang.c (lang_insert_orphan): Skip first assignment to dot
|
* ldlang.c (lang_insert_orphan): Skip first assignment to dot
|
||||||
|
|
|
@ -1362,9 +1362,9 @@ gld${EMULATION_NAME}_place_orphan (asection *s)
|
||||||
if (os != NULL
|
if (os != NULL
|
||||||
&& (os->bfd_section == NULL
|
&& (os->bfd_section == NULL
|
||||||
|| os->bfd_section->flags == 0
|
|| os->bfd_section->flags == 0
|
||||||
|| (bfd_match_sections_by_type (output_bfd,
|
|| (_bfd_elf_match_sections_by_type (output_bfd,
|
||||||
os->bfd_section,
|
os->bfd_section,
|
||||||
s->owner, s)
|
s->owner, s)
|
||||||
&& ((s->flags ^ os->bfd_section->flags)
|
&& ((s->flags ^ os->bfd_section->flags)
|
||||||
& (SEC_LOAD | SEC_ALLOC)) == 0)))
|
& (SEC_LOAD | SEC_ALLOC)) == 0)))
|
||||||
{
|
{
|
||||||
|
@ -1443,7 +1443,8 @@ gld${EMULATION_NAME}_place_orphan (asection *s)
|
||||||
}
|
}
|
||||||
after = place->os;
|
after = place->os;
|
||||||
if (after == NULL)
|
if (after == NULL)
|
||||||
after = lang_output_section_find_by_flags (s, &place->os);
|
after = lang_output_section_find_by_flags
|
||||||
|
(s, &place->os, _bfd_elf_match_sections_by_type);
|
||||||
if (after == NULL)
|
if (after == NULL)
|
||||||
/* *ABS* is always the first output section statement. */
|
/* *ABS* is always the first output section statement. */
|
||||||
after = &lang_output_section_statement.head->output_section_statement;
|
after = &lang_output_section_statement.head->output_section_statement;
|
||||||
|
|
|
@ -1621,7 +1621,7 @@ gld_${EMULATION_NAME}_place_orphan (asection *s)
|
||||||
place->os = lang_output_section_find (place->name);
|
place->os = lang_output_section_find (place->name);
|
||||||
after = place->os;
|
after = place->os;
|
||||||
if (after == NULL)
|
if (after == NULL)
|
||||||
after = lang_output_section_find_by_flags (s, &place->os);
|
after = lang_output_section_find_by_flags (s, &place->os, NULL);
|
||||||
if (after == NULL)
|
if (after == NULL)
|
||||||
/* *ABS* is always the first output section statement. */
|
/* *ABS* is always the first output section statement. */
|
||||||
after = (&lang_output_section_statement.head
|
after = (&lang_output_section_statement.head
|
||||||
|
|
76
ld/ldlang.c
76
ld/ldlang.c
|
@ -1147,7 +1147,8 @@ lang_output_section_statement_lookup (const char *const name)
|
||||||
|
|
||||||
lang_output_section_statement_type *
|
lang_output_section_statement_type *
|
||||||
lang_output_section_find_by_flags (const asection *sec,
|
lang_output_section_find_by_flags (const asection *sec,
|
||||||
lang_output_section_statement_type **exact)
|
lang_output_section_statement_type **exact,
|
||||||
|
lang_match_sec_type_func match_type)
|
||||||
{
|
{
|
||||||
lang_output_section_statement_type *first, *look, *found;
|
lang_output_section_statement_type *first, *look, *found;
|
||||||
flagword flags;
|
flagword flags;
|
||||||
|
@ -1165,9 +1166,8 @@ lang_output_section_find_by_flags (const asection *sec,
|
||||||
if (look->bfd_section != NULL)
|
if (look->bfd_section != NULL)
|
||||||
{
|
{
|
||||||
flags = look->bfd_section->flags;
|
flags = look->bfd_section->flags;
|
||||||
if (!bfd_match_sections_by_type (output_bfd,
|
if (match_type && !match_type (output_bfd, look->bfd_section,
|
||||||
look->bfd_section,
|
sec->owner, sec))
|
||||||
sec->owner, sec))
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
flags ^= sec->flags;
|
flags ^= sec->flags;
|
||||||
|
@ -1177,7 +1177,8 @@ lang_output_section_find_by_flags (const asection *sec,
|
||||||
}
|
}
|
||||||
if (found != NULL)
|
if (found != NULL)
|
||||||
{
|
{
|
||||||
*exact = found;
|
if (exact != NULL)
|
||||||
|
*exact = found;
|
||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1190,9 +1191,8 @@ lang_output_section_find_by_flags (const asection *sec,
|
||||||
if (look->bfd_section != NULL)
|
if (look->bfd_section != NULL)
|
||||||
{
|
{
|
||||||
flags = look->bfd_section->flags;
|
flags = look->bfd_section->flags;
|
||||||
if (!bfd_match_sections_by_type (output_bfd,
|
if (match_type && !match_type (output_bfd, look->bfd_section,
|
||||||
look->bfd_section,
|
sec->owner, sec))
|
||||||
sec->owner, sec))
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
flags ^= sec->flags;
|
flags ^= sec->flags;
|
||||||
|
@ -1200,10 +1200,8 @@ lang_output_section_find_by_flags (const asection *sec,
|
||||||
| SEC_CODE | SEC_SMALL_DATA | SEC_THREAD_LOCAL)))
|
| SEC_CODE | SEC_SMALL_DATA | SEC_THREAD_LOCAL)))
|
||||||
found = look;
|
found = look;
|
||||||
}
|
}
|
||||||
return found;
|
|
||||||
}
|
}
|
||||||
|
else if (sec->flags & (SEC_READONLY | SEC_THREAD_LOCAL))
|
||||||
if (sec->flags & (SEC_READONLY | SEC_THREAD_LOCAL))
|
|
||||||
{
|
{
|
||||||
/* .rodata can go after .text, .sdata2 after .rodata. */
|
/* .rodata can go after .text, .sdata2 after .rodata. */
|
||||||
for (look = first; look; look = look->next)
|
for (look = first; look; look = look->next)
|
||||||
|
@ -1212,9 +1210,8 @@ lang_output_section_find_by_flags (const asection *sec,
|
||||||
if (look->bfd_section != NULL)
|
if (look->bfd_section != NULL)
|
||||||
{
|
{
|
||||||
flags = look->bfd_section->flags;
|
flags = look->bfd_section->flags;
|
||||||
if (!bfd_match_sections_by_type (output_bfd,
|
if (match_type && !match_type (output_bfd, look->bfd_section,
|
||||||
look->bfd_section,
|
sec->owner, sec))
|
||||||
sec->owner, sec))
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
flags ^= sec->flags;
|
flags ^= sec->flags;
|
||||||
|
@ -1223,10 +1220,8 @@ lang_output_section_find_by_flags (const asection *sec,
|
||||||
&& !(look->flags & (SEC_SMALL_DATA | SEC_THREAD_LOCAL)))
|
&& !(look->flags & (SEC_SMALL_DATA | SEC_THREAD_LOCAL)))
|
||||||
found = look;
|
found = look;
|
||||||
}
|
}
|
||||||
return found;
|
|
||||||
}
|
}
|
||||||
|
else if (sec->flags & SEC_SMALL_DATA)
|
||||||
if (sec->flags & SEC_SMALL_DATA)
|
|
||||||
{
|
{
|
||||||
/* .sdata goes after .data, .sbss after .sdata. */
|
/* .sdata goes after .data, .sbss after .sdata. */
|
||||||
for (look = first; look; look = look->next)
|
for (look = first; look; look = look->next)
|
||||||
|
@ -1235,9 +1230,8 @@ lang_output_section_find_by_flags (const asection *sec,
|
||||||
if (look->bfd_section != NULL)
|
if (look->bfd_section != NULL)
|
||||||
{
|
{
|
||||||
flags = look->bfd_section->flags;
|
flags = look->bfd_section->flags;
|
||||||
if (!bfd_match_sections_by_type (output_bfd,
|
if (match_type && !match_type (output_bfd, look->bfd_section,
|
||||||
look->bfd_section,
|
sec->owner, sec))
|
||||||
sec->owner, sec))
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
flags ^= sec->flags;
|
flags ^= sec->flags;
|
||||||
|
@ -1247,10 +1241,8 @@ lang_output_section_find_by_flags (const asection *sec,
|
||||||
&& !(sec->flags & SEC_HAS_CONTENTS)))
|
&& !(sec->flags & SEC_HAS_CONTENTS)))
|
||||||
found = look;
|
found = look;
|
||||||
}
|
}
|
||||||
return found;
|
|
||||||
}
|
}
|
||||||
|
else if (sec->flags & SEC_HAS_CONTENTS)
|
||||||
if (sec->flags & SEC_HAS_CONTENTS)
|
|
||||||
{
|
{
|
||||||
/* .data goes after .rodata. */
|
/* .data goes after .rodata. */
|
||||||
for (look = first; look; look = look->next)
|
for (look = first; look; look = look->next)
|
||||||
|
@ -1259,9 +1251,8 @@ lang_output_section_find_by_flags (const asection *sec,
|
||||||
if (look->bfd_section != NULL)
|
if (look->bfd_section != NULL)
|
||||||
{
|
{
|
||||||
flags = look->bfd_section->flags;
|
flags = look->bfd_section->flags;
|
||||||
if (!bfd_match_sections_by_type (output_bfd,
|
if (match_type && !match_type (output_bfd, look->bfd_section,
|
||||||
look->bfd_section,
|
sec->owner, sec))
|
||||||
sec->owner, sec))
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
flags ^= sec->flags;
|
flags ^= sec->flags;
|
||||||
|
@ -1269,27 +1260,30 @@ lang_output_section_find_by_flags (const asection *sec,
|
||||||
| SEC_SMALL_DATA | SEC_THREAD_LOCAL)))
|
| SEC_SMALL_DATA | SEC_THREAD_LOCAL)))
|
||||||
found = look;
|
found = look;
|
||||||
}
|
}
|
||||||
return found;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
/* .bss goes last. */
|
|
||||||
for (look = first; look; look = look->next)
|
|
||||||
{
|
{
|
||||||
flags = look->flags;
|
/* .bss goes last. */
|
||||||
if (look->bfd_section != NULL)
|
for (look = first; look; look = look->next)
|
||||||
{
|
{
|
||||||
flags = look->bfd_section->flags;
|
flags = look->flags;
|
||||||
if (!bfd_match_sections_by_type (output_bfd,
|
if (look->bfd_section != NULL)
|
||||||
look->bfd_section,
|
{
|
||||||
sec->owner, sec))
|
flags = look->bfd_section->flags;
|
||||||
continue;
|
if (match_type && !match_type (output_bfd, look->bfd_section,
|
||||||
|
sec->owner, sec))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
flags ^= sec->flags;
|
||||||
|
if (!(flags & SEC_ALLOC))
|
||||||
|
found = look;
|
||||||
}
|
}
|
||||||
flags ^= sec->flags;
|
|
||||||
if (!(flags & SEC_ALLOC))
|
|
||||||
found = look;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return found;
|
if (found || !match_type)
|
||||||
|
return found;
|
||||||
|
|
||||||
|
return lang_output_section_find_by_flags (sec, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find the last output section before given output statement.
|
/* Find the last output section before given output statement.
|
||||||
|
|
|
@ -304,6 +304,9 @@ typedef void (*walk_wild_section_handler_t) (lang_wild_statement_type *,
|
||||||
callback_t callback,
|
callback_t callback,
|
||||||
void *data);
|
void *data);
|
||||||
|
|
||||||
|
typedef bfd_boolean (*lang_match_sec_type_func) (bfd *, const asection *,
|
||||||
|
bfd *, const asection *);
|
||||||
|
|
||||||
struct lang_wild_statement_struct
|
struct lang_wild_statement_struct
|
||||||
{
|
{
|
||||||
lang_statement_header_type header;
|
lang_statement_header_type header;
|
||||||
|
@ -521,7 +524,8 @@ extern void ldlang_add_file
|
||||||
extern lang_output_section_statement_type *lang_output_section_find
|
extern lang_output_section_statement_type *lang_output_section_find
|
||||||
(const char * const);
|
(const char * const);
|
||||||
extern lang_output_section_statement_type *lang_output_section_find_by_flags
|
extern lang_output_section_statement_type *lang_output_section_find_by_flags
|
||||||
(const asection *, lang_output_section_statement_type **exact);
|
(const asection *, lang_output_section_statement_type **,
|
||||||
|
lang_match_sec_type_func);
|
||||||
extern lang_output_section_statement_type *lang_insert_orphan
|
extern lang_output_section_statement_type *lang_insert_orphan
|
||||||
(asection *, const char *, lang_output_section_statement_type *,
|
(asection *, const char *, lang_output_section_statement_type *,
|
||||||
struct orphan_save *, etree_type *, lang_statement_list_type *);
|
struct orphan_save *, etree_type *, lang_statement_list_type *);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue