diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2005-10-15 14:57:55 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2005-10-15 14:57:55 +0000 |
commit | ecca98713a19ac7aac31886b4b15b806e63d9a99 (patch) | |
tree | 8606d4daeccd04e698371f934ba62278dd283d25 /ld/ldlang.c | |
parent | ff0929e51c0e9c26e0cf1e6b7229803ccd7cc769 (diff) | |
download | fsf-binutils-gdb-ecca98713a19ac7aac31886b4b15b806e63d9a99.zip fsf-binutils-gdb-ecca98713a19ac7aac31886b4b15b806e63d9a99.tar.gz fsf-binutils-gdb-ecca98713a19ac7aac31886b4b15b806e63d9a99.tar.bz2 |
bfd/
2005-10-15 H.J. Lu <hongjiu.lu@intel.com>
PR ld/1467
* elf-bfd.h (_bfd_elf_match_sections_by_type): New.
(_bfd_generic_match_sections_by_type): New. Defined.
* elf.c (_bfd_elf_match_sections_by_type): New.
* libbfd-in.h (_bfd_generic_match_sections_by_type): New.
* bfd-in2.h: Regenerated.
* libbfd.h: Likewise.
* libbfd.c (_bfd_generic_match_sections_by_type): New.
* targets.c (BFD_JUMP_TABLE_LINK): Initialize
_bfd_match_sections_by_type with
_bfd_generic_match_sections_by_type.
(bfd_target): Add _bfd_match_sections_by_type.
ld/
2005-10-15 H.J. Lu <hongjiu.lu@intel.com>
PR ld/1467
* emultempl/elf32.em: Include "elf-bfd.h".
(gld${EMULATION_NAME}_place_orphan): Check section type and
don't use section name for ELF input sections.
* ld.texinfo: Document orphan section processing.
* ldlang.c (lang_output_section_find_by_flags): Match section
types by calling bfd_match_sections_by_type.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r-- | ld/ldlang.c | 48 |
1 files changed, 42 insertions, 6 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c index 3ff4d81..b82a7e5 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -1149,7 +1149,13 @@ lang_output_section_find_by_flags (const asection *sec, { flags = look->flags; if (look->bfd_section != NULL) - flags = look->bfd_section->flags; + { + flags = look->bfd_section->flags; + if (!bfd_match_sections_by_type (output_bfd, + look->bfd_section, + sec->owner, sec)) + continue; + } flags ^= sec->flags; if (!(flags & (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE | SEC_SMALL_DATA | SEC_THREAD_LOCAL))) @@ -1168,7 +1174,13 @@ lang_output_section_find_by_flags (const asection *sec, { flags = look->flags; if (look->bfd_section != NULL) - flags = look->bfd_section->flags; + { + flags = look->bfd_section->flags; + if (!bfd_match_sections_by_type (output_bfd, + look->bfd_section, + sec->owner, sec)) + continue; + } flags ^= sec->flags; if (!(flags & (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_SMALL_DATA | SEC_THREAD_LOCAL))) @@ -1184,7 +1196,13 @@ lang_output_section_find_by_flags (const asection *sec, { flags = look->flags; if (look->bfd_section != NULL) - flags = look->bfd_section->flags; + { + flags = look->bfd_section->flags; + if (!bfd_match_sections_by_type (output_bfd, + look->bfd_section, + sec->owner, sec)) + continue; + } flags ^= sec->flags; if (!(flags & (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_READONLY)) @@ -1201,7 +1219,13 @@ lang_output_section_find_by_flags (const asection *sec, { flags = look->flags; if (look->bfd_section != NULL) - flags = look->bfd_section->flags; + { + flags = look->bfd_section->flags; + if (!bfd_match_sections_by_type (output_bfd, + look->bfd_section, + sec->owner, sec)) + continue; + } flags ^= sec->flags; if (!(flags & (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_THREAD_LOCAL)) @@ -1219,7 +1243,13 @@ lang_output_section_find_by_flags (const asection *sec, { flags = look->flags; if (look->bfd_section != NULL) - flags = look->bfd_section->flags; + { + flags = look->bfd_section->flags; + if (!bfd_match_sections_by_type (output_bfd, + look->bfd_section, + sec->owner, sec)) + continue; + } flags ^= sec->flags; if (!(flags & (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_SMALL_DATA | SEC_THREAD_LOCAL))) @@ -1233,7 +1263,13 @@ lang_output_section_find_by_flags (const asection *sec, { flags = look->flags; if (look->bfd_section != NULL) - flags = look->bfd_section->flags; + { + flags = look->bfd_section->flags; + if (!bfd_match_sections_by_type (output_bfd, + look->bfd_section, + sec->owner, sec)) + continue; + } flags ^= sec->flags; if (!(flags & SEC_ALLOC)) found = look; |