+2019-07-23 Alan Modra <amodra@gmail.com>
+
+ * elf-bfd.h (enum elf_gnu_osabi): Rename from elf_gnu_symbols.
+ Remove none, any, all enums.
+ (struct elf_obj_tdata): Rename has_gnu_symbols field to has_gnu_osabi.
+ (_bfd_elf_final_write_processing): Declare.
+ * elf.c (_bfd_elf_write_object_contents): Unconditionally call
+ elf_backend_final_write_processing.
+ (_bfd_elf_post_process_headers): Move body of function to..
+ (_bfd_elf_final_write_processing): ..here, but set EI_OSABI byte
+ only when not already set. Adjust for rename.
+ * elfxx-target.h (elf_backend_final_write_processing): Default to
+ _bfd_elf_final_write_processing.
+ * elf-hppa.h (elf_hppa_final_write_processing): Call
+ _bfd_elf_final_write_processing.
+ * elf-m10300.c (_bfd_mn10300_elf_final_write_processing): Likewise.
+ * elf-nacl.c (nacl_final_write_processing): Likewise.
+ * elf-vxworks.c (elf_vxworks_final_write_processing): Likewise.
+ * elf32-arc.c (arc_elf_final_write_processing): Likewise.
+ * elf32-avr.c (bfd_elf_avr_final_write_processing): Likewise.
+ * elf32-bfin.c (elf32_bfin_final_write_processing): Likewise.
+ * elf32-cr16.c (_bfd_cr16_elf_final_write_processing): Likewise.
+ * elf32-cris.c (cris_elf_final_write_processing): Likewise.
+ * elf32-h8300.c (elf32_h8_final_write_processing): Likewise.
+ * elf32-lm32.c (lm32_elf_final_write_processing): Likewise.
+ * elf32-m32r.c (m32r_elf_final_write_processing): Likewise.
+ * elf32-m68k.c (elf_m68k_final_write_processing): Likewise.
+ * elf32-msp430.c (bfd_elf_msp430_final_write_processing): Likewise.
+ * elf32-nds32.c (nds32_elf_final_write_processing): Likewise.
+ * elf32-or1k.c (or1k_elf_final_write_processing): Likewise.
+ * elf32-pj.c (pj_elf_final_write_processing): Likewise.
+ * elf32-v850.c (v850_elf_final_write_processing): Likewise.
+ * elf32-xc16x.c (elf32_xc16x_final_write_processing): Likewise.
+ * elf32-xtensa.c (elf_xtensa_final_write_processing): Likewise.
+ * elf64-ia64-vms.c (elf64_vms_final_write_processing): Likewise.
+ * elfnn-ia64.c (elfNN_ia64_final_write_processing): Likewise.
+ * elf32-arm.c (arm_final_write_processing): Split out from..
+ (elf32_arm_final_write_processing): ..here. Call
+ _bfd_elf_final_write_processing.
+ (elf32_arm_nacl_final_write_processing): Adjust.
+ * elfxx-mips.c (_bfd_mips_final_write_processing): Split out from..
+ (_bfd_mips_elf_final_write_processing): ..here. Call
+ _bfd_elf_final_write_processing.
+ * elfxx-mips.h (_bfd_mips_final_write_processing): Declare.
+ * elf32-mips.c (mips_vxworks_final_write_processing): Adjust.
+ * elf32-ppc.c (ppc_final_write_processing): Split out from..
+ (ppc_elf_final_write_processing): ..here. Call
+ _bfd_elf_final_write_processing.
+ (ppc_elf_vxworks_final_write_processing): Adjust.
+ * elf32-sparc.c (sparc_final_write_processing): Split out from..
+ (elf32_sparc_final_write_processing): ..here. Call
+ _bfd_elf_final_write_processing.
+ (elf32_sparc_vxworks_final_write_processing): Adjust.
+ * elf32-d10v.c (elf_backend_final_write_processing): Don't define.
+ * elf32-d30v.c (elf_backend_final_write_processing): Don't define.
+ * elf32-m68hc11.c (elf_backend_final_write_processing): Don't define.
+ * elf32-m68hc12.c (elf_backend_final_write_processing): Don't define.
+ * elf32-s12z.c (elf_backend_final_write_processing): Don't define.
+ * elf32-i386.c (elf_i386_check_relocs): Don't set has_gnu_symbols.
+ * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
+ * elflink.c (elf_link_add_object_symbols): Likewise.
+ (elf_link_output_symstrtab): Set has_gnu_osabi for symbols here
+ instead.
+
2019-07-23 Omar Majid <omajid@redhat.com>
* coffcode.h (coff_set_arch_mach_hook): Handle I386_APPLE_MAGIC,
/* Indicate if the bfd contains symbols that have the STT_GNU_IFUNC
symbol type or STB_GNU_UNIQUE binding. Used to set the osabi
field in the ELF header structure. */
-enum elf_gnu_symbols
+enum elf_gnu_osabi
{
- elf_gnu_symbol_none = 0,
- elf_gnu_symbol_any = 1 << 0,
- elf_gnu_symbol_ifunc = (elf_gnu_symbol_any | 1 << 1),
- elf_gnu_symbol_unique = (elf_gnu_symbol_any | 1 << 2),
- elf_gnu_symbol_all = (elf_gnu_symbol_ifunc | elf_gnu_symbol_unique)
+ elf_gnu_osabi_ifunc = 1 << 1,
+ elf_gnu_osabi_unique = 1 << 2,
};
typedef struct elf_section_list
or was found via a DT_NEEDED entry. */
ENUM_BITFIELD (dynamic_lib_link_class) dyn_lib_class : 4;
- /* Whether if the bfd contains symbols that have the STT_GNU_IFUNC
- symbol type or STB_GNU_UNIQUE binding. */
- ENUM_BITFIELD (elf_gnu_symbols) has_gnu_symbols : 3;
+ /* Whether the bfd uses OS specific bits that require ELFOSABI_GNU. */
+ ENUM_BITFIELD (elf_gnu_osabi) has_gnu_osabi : 3;
/* Whether if the bfd contains the GNU_PROPERTY_NO_COPY_ON_PROTECTED
property. */
extern struct bfd_link_hash_entry *bfd_elf_define_start_stop
(struct bfd_link_info *, const char *, asection *);
-extern void _bfd_elf_post_process_headers (bfd * , struct bfd_link_info *);
+extern void _bfd_elf_post_process_headers (bfd *, struct bfd_link_info *);
+
+extern void _bfd_elf_final_write_processing (bfd *, bfd_boolean);
extern const bfd_target *bfd_elf32_object_p
(bfd *);
}
static void
-elf_hppa_final_write_processing (bfd *abfd,
- bfd_boolean linker ATTRIBUTE_UNUSED)
+elf_hppa_final_write_processing (bfd *abfd, bfd_boolean linker)
{
int mach = bfd_get_mach (abfd);
a step backwards with the ELF
based toolchains. */
| EF_PARISC_TRAPNIL);
+ _bfd_elf_final_write_processing (abfd, linker);
}
/* Comparison function for qsort to sort unwind section during a
number. */
static void
-_bfd_mn10300_elf_final_write_processing (bfd *abfd,
- bfd_boolean linker ATTRIBUTE_UNUSED)
+_bfd_mn10300_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
{
unsigned long val;
elf_elfheader (abfd)->e_flags &= ~ (EF_MN10300_MACH);
elf_elfheader (abfd)->e_flags |= val;
+ _bfd_elf_final_write_processing (abfd, linker);
}
static bfd_boolean
}
void
-nacl_final_write_processing (bfd *abfd, bfd_boolean linker ATTRIBUTE_UNUSED)
+nacl_final_write_processing (bfd *abfd, bfd_boolean linker)
{
struct elf_segment_map *seg;
for (seg = elf_seg_map (abfd); seg != NULL; seg = seg->next)
free (fill);
}
+ _bfd_elf_final_write_processing (abfd, linker);
}
/* Set the sh_link and sh_info fields on the static plt relocation secton. */
void
-elf_vxworks_final_write_processing (bfd *abfd,
- bfd_boolean linker ATTRIBUTE_UNUSED)
+elf_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
{
asection * sec;
struct bfd_elf_section_data *d;
sec = bfd_get_section_by_name (abfd, ".plt");
if (sec)
d->this_hdr.sh_info = elf_section_data (sec)->this_idx;
+ _bfd_elf_final_write_processing (abfd, linker);
}
/* Add the dynamic entries required by VxWorks. These point to the
|| !_bfd_elf_strtab_emit (abfd, elf_shstrtab (abfd))))
return FALSE;
- if (bed->elf_backend_final_write_processing)
- (*bed->elf_backend_final_write_processing) (abfd, elf_linker (abfd));
+ (*bed->elf_backend_final_write_processing) (abfd, elf_linker (abfd));
if (!bed->s->write_shdrs_and_ehdr (abfd))
return FALSE;
"LARGE_COMMON", 0, SEC_IS_COMMON);
void
-_bfd_elf_post_process_headers (bfd * abfd,
- struct bfd_link_info * link_info ATTRIBUTE_UNUSED)
+_bfd_elf_post_process_headers (bfd *abfd ATTRIBUTE_UNUSED,
+ struct bfd_link_info *info ATTRIBUTE_UNUSED)
{
- Elf_Internal_Ehdr * i_ehdrp; /* ELF file header, internal form. */
+}
+
+void
+_bfd_elf_final_write_processing (bfd *abfd,
+ bfd_boolean linker ATTRIBUTE_UNUSED)
+{
+ Elf_Internal_Ehdr *i_ehdrp; /* ELF file header, internal form. */
i_ehdrp = elf_elfheader (abfd);
- i_ehdrp->e_ident[EI_OSABI] = get_elf_backend_data (abfd)->elf_osabi;
+ if (i_ehdrp->e_ident[EI_OSABI] == ELFOSABI_NONE)
+ i_ehdrp->e_ident[EI_OSABI] = get_elf_backend_data (abfd)->elf_osabi;
/* To make things simpler for the loader on Linux systems we set the
osabi field to ELFOSABI_GNU if the binary contains symbols of
the STT_GNU_IFUNC type or STB_GNU_UNIQUE binding. */
if (i_ehdrp->e_ident[EI_OSABI] == ELFOSABI_NONE
- && elf_tdata (abfd)->has_gnu_symbols)
+ && elf_tdata (abfd)->has_gnu_osabi)
i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_GNU;
}
This gets the ARC architecture right based on the machine number. */
static void
-arc_elf_final_write_processing (bfd * abfd,
- bfd_boolean linker ATTRIBUTE_UNUSED)
+arc_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
{
unsigned long emf;
int osver = bfd_elf_get_obj_attr_int (abfd, OBJ_ATTR_PROC,
e_flags |= E_ARC_OSABI_V3;
elf_elfheader (abfd)->e_flags |= e_flags;
+ _bfd_elf_final_write_processing (abfd, linker);
}
#ifdef ARC_ENABLE_DEBUG
}
static void
-elf32_arm_final_write_processing (bfd *abfd, bfd_boolean linker ATTRIBUTE_UNUSED)
+arm_final_write_processing (bfd *abfd, bfd_boolean linker ATTRIBUTE_UNUSED)
{
bfd_arm_update_notes (abfd, ARM_NOTE_SECTION);
}
+static void
+elf32_arm_final_write_processing (bfd *abfd, bfd_boolean linker)
+{
+ arm_final_write_processing (abfd, linker);
+ _bfd_elf_final_write_processing (abfd, linker);
+}
+
/* Return TRUE if this is an unwinding table entry. */
static bfd_boolean
static void
elf32_arm_nacl_final_write_processing (bfd *abfd, bfd_boolean linker)
{
- elf32_arm_final_write_processing (abfd, linker);
+ arm_final_write_processing (abfd, linker);
nacl_final_write_processing (abfd, linker);
}
static void
elf32_arm_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
{
- elf32_arm_final_write_processing (abfd, linker);
+ arm_final_write_processing (abfd, linker);
elf_vxworks_final_write_processing (abfd, linker);
}
number. */
static void
-bfd_elf_avr_final_write_processing (bfd *abfd,
- bfd_boolean linker ATTRIBUTE_UNUSED)
+bfd_elf_avr_final_write_processing (bfd *abfd, bfd_boolean linker)
{
unsigned long val;
elf_elfheader (abfd)->e_machine = EM_AVR;
elf_elfheader (abfd)->e_flags &= ~ EF_AVR_MACH;
elf_elfheader (abfd)->e_flags |= val;
+ _bfd_elf_final_write_processing (abfd, linker);
}
/* Set the right machine number. */
bfd_boolean elf32_bfin_data_in_l1 = 0;
static void
-elf32_bfin_final_write_processing (bfd *abfd,
- bfd_boolean linker ATTRIBUTE_UNUSED)
+elf32_bfin_final_write_processing (bfd *abfd, bfd_boolean linker)
{
if (elf32_bfin_code_in_l1)
elf_elfheader (abfd)->e_flags |= EF_BFIN_CODE_IN_L1;
if (elf32_bfin_data_in_l1)
elf_elfheader (abfd)->e_flags |= EF_BFIN_DATA_IN_L1;
+ _bfd_elf_final_write_processing (abfd, linker);
}
/* Return TRUE if the name is a local label.
number. */
static void
-_bfd_cr16_elf_final_write_processing (bfd *abfd,
- bfd_boolean linker ATTRIBUTE_UNUSED)
+_bfd_cr16_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
{
unsigned long val;
switch (bfd_get_mach (abfd))
val = EM_CR16;
break;
}
-
-
elf_elfheader (abfd)->e_flags |= val;
+ _bfd_elf_final_write_processing (abfd, linker);
}
flags from mach type. */
static void
-cris_elf_final_write_processing (bfd *abfd,
- bfd_boolean linker ATTRIBUTE_UNUSED)
+cris_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
{
unsigned long e_flags = elf_elfheader (abfd)->e_flags;
}
elf_elfheader (abfd)->e_flags = e_flags;
+ _bfd_elf_final_write_processing (abfd, linker);
}
/* Set the mach type from e_flags value. */
#define elf_info_to_howto NULL
#define elf_info_to_howto_rel d10v_info_to_howto_rel
#define elf_backend_object_p 0
-#define elf_backend_final_write_processing 0
#define elf_backend_gc_mark_hook elf32_d10v_gc_mark_hook
#define elf_backend_check_relocs elf32_d10v_check_relocs
#define elf_backend_relocate_section elf32_d10v_relocate_section
#define elf_info_to_howto d30v_info_to_howto_rela
#define elf_info_to_howto_rel d30v_info_to_howto_rel
#define elf_backend_object_p 0
-#define elf_backend_final_write_processing 0
#include "elf32-target.h"
static bfd_boolean elf32_h8_info_to_howto_rel
(bfd *, arelent *, Elf_Internal_Rela *);
static unsigned long elf32_h8_mach (flagword);
-static void elf32_h8_final_write_processing (bfd *, bfd_boolean);
static bfd_boolean elf32_h8_object_p (bfd *);
static bfd_boolean elf32_h8_merge_private_bfd_data
(bfd *, struct bfd_link_info *);
into the flags field in the object file. */
static void
-elf32_h8_final_write_processing (bfd *abfd,
- bfd_boolean linker ATTRIBUTE_UNUSED)
+elf32_h8_final_write_processing (bfd *abfd, bfd_boolean linker)
{
unsigned long val;
elf_elfheader (abfd)->e_flags &= ~ (EF_H8_MACH);
elf_elfheader (abfd)->e_flags |= val;
+ _bfd_elf_final_write_processing (abfd, linker);
}
/* Return nonzero if ABFD represents a valid H8 ELF object file; also
/* It is referenced by a non-shared object. */
h->ref_regular = 1;
-
- if (h->type == STT_GNU_IFUNC)
- elf_tdata (info->output_bfd)->has_gnu_symbols
- |= elf_gnu_symbol_ifunc;
}
if (r_type == R_386_GOT32X
/* Set machine type flags just before file is written out. */
static void
-lm32_elf_final_write_processing (bfd *abfd, bfd_boolean linker ATTRIBUTE_UNUSED)
+lm32_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
{
elf_elfheader (abfd)->e_machine = EM_LATTICEMICO32;
elf_elfheader (abfd)->e_flags &=~ EF_LM32_MACH;
default:
abort ();
}
+ _bfd_elf_final_write_processing (abfd, linker);
}
/* Set the GP value for OUTPUT_BFD. Returns FALSE if this is a
/* Store the machine number in the flags field. */
static void
-m32r_elf_final_write_processing (bfd *abfd,
- bfd_boolean linker ATTRIBUTE_UNUSED)
+m32r_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
{
unsigned long val;
elf_elfheader (abfd)->e_flags &=~ EF_M32R_ARCH;
elf_elfheader (abfd)->e_flags |= val;
+ _bfd_elf_final_write_processing (abfd, linker);
}
/* Function to keep M32R specific file flags. */
#define elf_backend_relocate_section elf32_m68hc11_relocate_section
#define elf_backend_add_symbol_hook elf32_m68hc11_add_symbol_hook
#define elf_backend_object_p 0
-#define elf_backend_final_write_processing 0
#define elf_backend_can_gc_sections 1
#define elf_backend_special_sections elf32_m68hc11_special_sections
#define elf_backend_merge_symbol_attribute elf32_m68hc11_merge_symbol_attribute
#define elf_backend_check_relocs elf32_m68hc11_check_relocs
#define elf_backend_relocate_section elf32_m68hc11_relocate_section
#define elf_backend_object_p m68hc12_elf_set_mach_from_flags
-#define elf_backend_final_write_processing 0
#define elf_backend_can_gc_sections 1
#define elf_backend_special_sections elf32_m68hc12_special_sections
#define elf_backend_post_process_headers elf32_m68hc11_post_process_headers
field based on the machine number. */
static void
-elf_m68k_final_write_processing (bfd *abfd,
- bfd_boolean linker ATTRIBUTE_UNUSED)
+elf_m68k_final_write_processing (bfd *abfd, bfd_boolean linker)
{
int mach = bfd_get_mach (abfd);
unsigned long e_flags = elf_elfheader (abfd)->e_flags;
}
elf_elfheader (abfd)->e_flags = e_flags;
}
+ _bfd_elf_final_write_processing (abfd, linker);
}
/* Keep m68k-specific flags in the ELF header. */
static void
mips_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
{
- _bfd_mips_elf_final_write_processing (abfd, linker);
+ _bfd_mips_final_write_processing (abfd, linker);
elf_vxworks_final_write_processing (abfd, linker);
}
number. */
static void
-bfd_elf_msp430_final_write_processing (bfd * abfd,
- bfd_boolean linker ATTRIBUTE_UNUSED)
+bfd_elf_msp430_final_write_processing (bfd *abfd, bfd_boolean linker)
{
unsigned long val;
elf_elfheader (abfd)->e_machine = EM_MSP430;
elf_elfheader (abfd)->e_flags &= ~EF_MSP430_MACH;
elf_elfheader (abfd)->e_flags |= val;
+ _bfd_elf_final_write_processing (abfd, linker);
}
/* Set the right machine number. */
/* Store the machine number in the flags field. */
static void
-nds32_elf_final_write_processing (bfd *abfd,
- bfd_boolean linker ATTRIBUTE_UNUSED)
+nds32_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
{
unsigned long val;
static unsigned int cur_mach = 0;
elf_elfheader (abfd)->e_flags &= ~EF_NDS_ARCH;
elf_elfheader (abfd)->e_flags |= val;
+ _bfd_elf_final_write_processing (abfd, linker);
}
/* Function to keep NDS32 specific file flags. */
/* Store the machine number in the flags field. */
static void
-or1k_elf_final_write_processing (bfd *abfd,
- bfd_boolean linker ATTRIBUTE_UNUSED)
+or1k_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
{
switch (bfd_get_mach (abfd))
{
elf_elfheader (abfd)->e_flags |= EF_OR1K_NODELAY;
break;
}
+ _bfd_elf_final_write_processing (abfd, linker);
}
static bfd_boolean
e_flags field. */
static void
-pj_elf_final_write_processing (bfd *abfd,
- bfd_boolean linker ATTRIBUTE_UNUSED)
+pj_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
{
elf_elfheader (abfd)->e_flags |= EF_PICOJAVA_ARCH;
elf_elfheader (abfd)->e_flags |= EF_PICOJAVA_GNUCALLS;
+ _bfd_elf_final_write_processing (abfd, linker);
}
#define TARGET_BIG_SYM pj_elf32_vec
/* Finally we can generate the output section. */
static void
-ppc_elf_final_write_processing (bfd *abfd, bfd_boolean linker ATTRIBUTE_UNUSED)
+ppc_final_write_processing (bfd *abfd, bfd_boolean linker ATTRIBUTE_UNUSED)
{
bfd_byte *buffer;
asection *asec;
apuinfo_list_finish ();
}
+
+static void
+ppc_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
+{
+ ppc_final_write_processing (abfd, linker);
+ _bfd_elf_final_write_processing (abfd, linker);
+}
\f
static bfd_boolean
is_nonpic_glink_stub (bfd *abfd, asection *glink, bfd_vma off)
static void
ppc_elf_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
{
- ppc_elf_final_write_processing (abfd, linker);
+ ppc_final_write_processing (abfd, linker);
elf_vxworks_final_write_processing (abfd, linker);
}
#define elf_info_to_howto NULL
#define elf_info_to_howto_rel s12z_info_to_howto_rel
#define elf_backend_object_p s12z_elf_set_mach_from_flags
-#define elf_backend_final_write_processing NULL
#include "elf32-target.h"
We need to set the e_machine field appropriately. */
static void
-elf32_sparc_final_write_processing (bfd *abfd,
- bfd_boolean linker ATTRIBUTE_UNUSED)
+sparc_final_write_processing (bfd *abfd, bfd_boolean linker ATTRIBUTE_UNUSED)
{
switch (bfd_get_mach (abfd))
{
}
}
+static void
+elf32_sparc_final_write_processing (bfd *abfd, bfd_boolean linker)
+{
+ sparc_final_write_processing (abfd, linker);
+ _bfd_elf_final_write_processing (abfd, linker);
+}
+
/* Used to decide how to sort relocs in an optimal manner for the
dynamic linker, before writing them out. */
static void
elf32_sparc_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
{
- elf32_sparc_final_write_processing (abfd, linker);
+ sparc_final_write_processing (abfd, linker);
elf_vxworks_final_write_processing (abfd, linker);
}
/* Store the machine number in the flags field. */
static void
-v850_elf_final_write_processing (bfd *abfd,
- bfd_boolean linker ATTRIBUTE_UNUSED)
+v850_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
{
unsigned long val;
default:
break;
}
+ _bfd_elf_final_write_processing (abfd, linker);
}
/* Function to keep V850 specific file flags. */
static void
-elf32_xc16x_final_write_processing (bfd *abfd,
- bfd_boolean linker ATTRIBUTE_UNUSED)
+elf32_xc16x_final_write_processing (bfd *abfd, bfd_boolean linker)
{
unsigned long val;
}
elf_elfheader (abfd)->e_flags |= val;
+ _bfd_elf_final_write_processing (abfd, linker);
}
static unsigned long
number. */
static void
-elf_xtensa_final_write_processing (bfd *abfd,
- bfd_boolean linker ATTRIBUTE_UNUSED)
+elf_xtensa_final_write_processing (bfd *abfd, bfd_boolean linker)
{
int mach;
unsigned long val;
elf_elfheader (abfd)->e_flags &= (~ EF_XTENSA_MACH);
elf_elfheader (abfd)->e_flags |= val;
+ _bfd_elf_final_write_processing (abfd, linker);
}
object file. */
static void
-elf64_vms_final_write_processing (bfd *abfd,
- bfd_boolean linker ATTRIBUTE_UNUSED)
+elf64_vms_final_write_processing (bfd *abfd, bfd_boolean linker)
{
Elf_Internal_Shdr *hdr;
asection *s;
elf_elfheader (abfd)->e_flags = flags;
elf_flags_init (abfd) = TRUE;
}
+ _bfd_elf_final_write_processing (abfd, linker);
}
static bfd_boolean
{
/* It is referenced by a non-shared object. */
h->ref_regular = 1;
-
- if (h->type == STT_GNU_IFUNC)
- elf_tdata (info->output_bfd)->has_gnu_symbols
- |= elf_gnu_symbol_ifunc;
}
converted_reloc = FALSE;
(struct bfd_link_hash_entry **) sym_hash)))
goto error_free_vers;
- if ((abfd->flags & DYNAMIC) == 0
- && (bfd_get_flavour (info->output_bfd)
- == bfd_target_elf_flavour))
- {
- if (ELF_ST_TYPE (isym->st_info) == STT_GNU_IFUNC)
- elf_tdata (info->output_bfd)->has_gnu_symbols
- |= elf_gnu_symbol_ifunc;
- if ((flags & BSF_GNU_UNIQUE))
- elf_tdata (info->output_bfd)->has_gnu_symbols
- |= elf_gnu_symbol_unique;
- }
-
h = *sym_hash;
/* We need to make sure that indirect symbol dynamic flags are
updated. */
return ret;
}
+ if (ELF_ST_TYPE (elfsym->st_info) == STT_GNU_IFUNC)
+ elf_tdata (flinfo->output_bfd)->has_gnu_osabi |= elf_gnu_osabi_ifunc;
+ if (ELF_ST_BIND (elfsym->st_info) == STB_GNU_UNIQUE)
+ elf_tdata (flinfo->output_bfd)->has_gnu_osabi |= elf_gnu_osabi_unique;
+
if (name == NULL
|| *name == '\0'
|| (input_sec->flags & SEC_EXCLUDE))
object file. */
static void
-elfNN_ia64_final_write_processing (bfd *abfd,
- bfd_boolean linker ATTRIBUTE_UNUSED)
+elfNN_ia64_final_write_processing (bfd *abfd, bfd_boolean linker)
{
Elf_Internal_Shdr *hdr;
asection *s;
elf_elfheader(abfd)->e_flags = flags;
elf_flags_init (abfd) = TRUE;
}
+ _bfd_elf_final_write_processing (abfd, linker);
}
/* Hook called by the linker routine which adds symbols from an object
number. This is used by both the 32-bit and the 64-bit ABI. */
void
-_bfd_mips_elf_final_write_processing (bfd *abfd,
- bfd_boolean linker ATTRIBUTE_UNUSED)
+_bfd_mips_final_write_processing (bfd *abfd,
+ bfd_boolean linker ATTRIBUTE_UNUSED)
{
unsigned int i;
Elf_Internal_Shdr **hdrpp;
}
}
}
+
+void
+_bfd_mips_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
+{
+ _bfd_mips_final_write_processing (abfd, linker);
+ _bfd_elf_final_write_processing (abfd, linker);
+}
\f
/* When creating an IRIX5 executable, we need REGINFO and RTPROC
segments. */
(bfd *, struct bfd_link_info *);
extern bfd_boolean _bfd_mips_elf_sort_relocs_p
(asection *);
+extern void _bfd_mips_final_write_processing
+ (bfd *, bfd_boolean);
extern void _bfd_mips_elf_final_write_processing
(bfd *, bfd_boolean);
extern int _bfd_mips_elf_additional_program_headers
#define elf_backend_begin_write_processing 0
#endif
#ifndef elf_backend_final_write_processing
-#define elf_backend_final_write_processing 0
+#define elf_backend_final_write_processing _bfd_elf_final_write_processing
#endif
#ifndef elf_backend_additional_program_headers
#define elf_backend_additional_program_headers 0