/* A pointer to the .eh_frame section. */
asection *eh_frame_section;
+ /* A pointer to the .sframe section. */
+ asection *sframe_section;
+
/* Symbol buffer. */
void *symbuf;
#define elf_dynverref(bfd) (elf_tdata(bfd) -> dynverref_section)
#define elf_eh_frame_section(bfd) \
(elf_tdata(bfd) -> eh_frame_section)
+#define elf_sframe_section(bfd) \
+ (elf_tdata(bfd) -> sframe_section)
#define elf_section_syms(bfd) (elf_tdata(bfd) -> o->section_syms)
#define elf_num_section_syms(bfd) (elf_tdata(bfd) -> o->num_section_syms)
#define core_prpsinfo(bfd) (elf_tdata(bfd) -> prpsinfo)
}
if (sec->size == 0
- || (sec->flags & SEC_HAS_CONTENTS) == 0
- || sec->sec_info_type != SEC_INFO_TYPE_NONE)
+ || (sec->flags & SEC_HAS_CONTENTS) == 0)
{
/* This file does not contain .sframe information. */
return false;
}
+ /* Check if this section was already parsed. */
+ if (sec->sec_info_type == SEC_INFO_TYPE_SFRAME)
+ return true;
+
if (bfd_is_abs_section (sec->output_section))
{
/* At least one of the sections is being discarded from the
elf_gc_mark_hook_fn gc_mark_hook)
{
bool ret;
- asection *group_sec, *eh_frame;
+ asection *group_sec, *eh_frame, *sframe;
sec->gc_mark = 1;
/* Look through the section relocs. */
ret = true;
eh_frame = elf_eh_frame_section (sec->owner);
+ sframe = elf_sframe_section (sec->owner);
+
if ((sec->flags & SEC_RELOC) != 0
&& sec->reloc_count > 0
- && sec != eh_frame)
+ && sec != eh_frame
+ && sec != sframe)
{
struct elf_reloc_cookie cookie;
fini_reloc_cookie_for_section (&cookie, sec);
sec = bfd_get_next_section_by_name (NULL, sec);
}
+
+ /* Handle .sframe section. */
+ sec = bfd_get_section_by_name (sub, ".sframe");
+ while (sec && init_reloc_cookie_for_section (&cookie, info, sec,
+ false))
+ {
+ _bfd_elf_parse_sframe (sub, info, sec, &cookie);
+
+ if (sec->sec_info
+ && (sec->flags & SEC_LINKER_CREATED) == 0)
+ elf_sframe_section (sub) = sec;
+
+ fini_reloc_cookie_for_section (&cookie, sec);
+ sec = bfd_get_next_section_by_name (NULL, sec);
+ }
}
/* Apply transitive closure to the vtable entry usage info. */
${OTHER_READONLY_SECTIONS}
.eh_frame_hdr ${RELOCATING-0} : { *(.eh_frame_hdr)${RELOCATING+ *(.eh_frame_entry .eh_frame_entry.*)} }
.eh_frame ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.eh_frame))${RELOCATING+ *(.eh_frame.*)} }
- .sframe ${RELOCATING-0} : ONLY_IF_RO { *(.sframe)${RELOCATING+ *(.sframe.*)} }
+ .sframe ${RELOCATING-0} : ONLY_IF_RO { KEEP (*(.sframe))${RELOCATING+ *(.sframe.*)} }
.gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table${RELOCATING+ .gcc_except_table.*}) }
.gnu_extab ${RELOCATING-0} : ONLY_IF_RO { *(.gnu_extab*) }
cat <<EOF
/* Exception handling. */
.eh_frame ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.eh_frame))${RELOCATING+ *(.eh_frame.*)} }
- .sframe ${RELOCATING-0} : ONLY_IF_RW { *(.sframe)${RELOCATING+ *(.sframe.*)} }
+ .sframe ${RELOCATING-0} : ONLY_IF_RW { KEEP (*(.sframe))${RELOCATING+ *(.sframe.*)} }
.gnu_extab ${RELOCATING-0} : ONLY_IF_RW { *(.gnu_extab) }
.gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table${RELOCATING+ .gcc_except_table.*}) }
.exception_ranges ${RELOCATING-0} : ONLY_IF_RW { *(.exception_ranges${RELOCATING+*}) }