/* Structures used by the eh_frame optimization code. */
struct eh_cie_fde
{
- /* For FDEs, this points to the CIE used. */
- struct eh_cie_fde *cie_inf;
+ union {
+ struct {
+ /* If REMOVED == 1, this is the CIE that the FDE originally used.
+ The CIE belongs to the same .eh_frame input section as the FDE.
+
+ If REMOVED == 0, this is the CIE that we have chosen to use for
+ the output FDE. The CIE's REMOVED field is also 0, but the CIE
+ might belong to a different .eh_frame input section from the FDE. */
+ struct eh_cie_fde *cie_inf;
+ } fde;
+ struct {
+ /* In general, equivalent CIEs are grouped together, with one CIE
+ representing all the others in a group. If REMOVED == 0,
+ this CIE is the group representative. If REMOVED == 1,
+ following this pointer brings us "closer" to the CIE's group
+ representative, and reapplying always gives the representative. */
+ struct eh_cie_fde *merged;
+ } cie;
+ } u;
+ unsigned int reloc_index;
unsigned int size;
unsigned int offset;
unsigned int new_offset;
- unsigned char fde_encoding;
- unsigned char lsda_encoding;
- unsigned char lsda_offset;
+ unsigned int fde_encoding : 8;
+ unsigned int lsda_encoding : 8;
+ unsigned int lsda_offset : 8;
unsigned int cie : 1;
unsigned int removed : 1;
unsigned int add_augmentation_size : 1;
asection *hdr_sec;
unsigned int fde_count, array_count;
struct eh_frame_array_ent *array;
+ /* TRUE if all .eh_frames have been parsd. */
+ bfd_boolean parsed_eh_frames;
/* TRUE if .eh_frame_hdr should contain the sorted search table.
We build it if we successfully read all .eh_frame input sections
and recognize them. */
extern void _bfd_elf_strtab_finalize
(struct elf_strtab_hash *);
+extern void _bfd_elf_begin_eh_frame_parsing
+ (struct bfd_link_info *info);
+extern void _bfd_elf_parse_eh_frame
+ (bfd *, struct bfd_link_info *, asection *, struct elf_reloc_cookie *);
+extern void _bfd_elf_end_eh_frame_parsing
+ (struct bfd_link_info *info);
+
extern bfd_boolean _bfd_elf_discard_section_eh_frame
(bfd *, struct bfd_link_info *, asection *,
bfd_boolean (*) (bfd_vma, void *), struct elf_reloc_cookie *);
extern bfd_boolean _bfd_elf_symbol_refs_local_p
(struct elf_link_hash_entry *, struct bfd_link_info *, bfd_boolean);
-extern void bfd_elf_perform_complex_relocation
+extern bfd_reloc_status_type bfd_elf_perform_complex_relocation
(bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, bfd_vma);
extern bfd_boolean _bfd_elf_setup_sections
(asection *, struct bfd_link_info *, Elf_Internal_Rela *,
struct elf_link_hash_entry *, Elf_Internal_Sym *);
+extern asection *_bfd_elf_gc_mark_rsec
+ (struct bfd_link_info *, asection *, elf_gc_mark_hook_fn,
+ struct elf_reloc_cookie *);
+
+extern bfd_boolean _bfd_elf_gc_mark_reloc
+ (struct bfd_link_info *, asection *, elf_gc_mark_hook_fn,
+ struct elf_reloc_cookie *, bfd_boolean);
+
extern bfd_boolean _bfd_elf_gc_mark
- (struct bfd_link_info *, asection *,
- asection * (*) (asection *, struct bfd_link_info *, Elf_Internal_Rela *,
- struct elf_link_hash_entry *, Elf_Internal_Sym *));
+ (struct bfd_link_info *, asection *, elf_gc_mark_hook_fn);
extern bfd_boolean bfd_elf_gc_common_finalize_got_offsets
(bfd *, struct bfd_link_info *);