Complain about mbind, ifunc, and unique in final_write
It's not as good as complaining in gas/config/obj-elf.c since you lose any reference to the source file. bfd/ * elf-bfd.h (struct elf_backend_data): Return bfd_boolean from elf_backend_final_write_processing, don't pass linker arg. (_bfd_elf_final_write_processing): Update prototype. * elf.c (_bfd_elf_write_object_contents): Adjust call. (_bfd_elf_final_write_processing): Return error on incompatible OSABI and has_gnu_osabi. Remove linker arg. * elf-nacl.h (nacl_final_write_processing): Update prototype. * elf-vxworks.h (elf_vxworks_final_write_processing): Likewise. * elfxx-mips.h (_bfd_mips_final_write_processing): Likewise. (_bfd_mips_elf_final_write_processing): Likewise. * elf-hppa.h (elf_hppa_final_write_processing): Return status and remove linker arg. * 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-arm.c (arm_final_write_processing): Likewise. (elf32_arm_final_write_processing): Likewise. (elf32_arm_nacl_final_write_processing): Likewise. (elf32_arm_vxworks_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-mips.c (mips_vxworks_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-ppc.c (ppc_final_write_processing): Likewise. (ppc_elf_final_write_processing): Likewise. (ppc_elf_vxworks_final_write_processing): Likewise. * elf32-sparc.c (sparc_final_write_processing): Likewise. (elf32_sparc_final_write_processing): Likewise. (elf32_sparc_vxworks_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. * elfxx-mips.c (_bfd_mips_final_write_processing): Likewise. (_bfd_mips_elf_final_write_processing): Likewise. gas/ * config/obj-elf.c (obj_elf_section, obj_elf_type): Set has_gnu_osabi. * testsuite/gas/elf/section12a.d: Update xfails. * testsuite/gas/elf/section12b.d: Likewise.
This commit is contained in:
parent
c5e20471be
commit
cc364be6ff
@ -1,3 +1,52 @@
|
||||
2019-07-24 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* elf-bfd.h (struct elf_backend_data): Return bfd_boolean from
|
||||
elf_backend_final_write_processing, don't pass linker arg.
|
||||
(_bfd_elf_final_write_processing): Update prototype.
|
||||
* elf.c (_bfd_elf_write_object_contents): Adjust call.
|
||||
(_bfd_elf_final_write_processing): Return error on incompatible
|
||||
OSABI and has_gnu_osabi. Remove linker arg.
|
||||
* elf-nacl.h (nacl_final_write_processing): Update prototype.
|
||||
* elf-vxworks.h (elf_vxworks_final_write_processing): Likewise.
|
||||
* elfxx-mips.h (_bfd_mips_final_write_processing): Likewise.
|
||||
(_bfd_mips_elf_final_write_processing): Likewise.
|
||||
* elf-hppa.h (elf_hppa_final_write_processing): Return status
|
||||
and remove linker arg.
|
||||
* 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-arm.c (arm_final_write_processing): Likewise.
|
||||
(elf32_arm_final_write_processing): Likewise.
|
||||
(elf32_arm_nacl_final_write_processing): Likewise.
|
||||
(elf32_arm_vxworks_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-mips.c (mips_vxworks_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-ppc.c (ppc_final_write_processing): Likewise.
|
||||
(ppc_elf_final_write_processing): Likewise.
|
||||
(ppc_elf_vxworks_final_write_processing): Likewise.
|
||||
* elf32-sparc.c (sparc_final_write_processing): Likewise.
|
||||
(elf32_sparc_final_write_processing): Likewise.
|
||||
(elf32_sparc_vxworks_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.
|
||||
* elfxx-mips.c (_bfd_mips_final_write_processing): Likewise.
|
||||
(_bfd_mips_elf_final_write_processing): Likewise.
|
||||
|
||||
2019-07-24 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* elf-vxworks.c (elf_vxworks_final_write_processing): Don't return
|
||||
|
@ -1141,10 +1141,9 @@ struct elf_backend_data
|
||||
(bfd *, struct bfd_link_info *);
|
||||
|
||||
/* A function to do any final processing needed for the ELF file
|
||||
before writing it out. The LINKER argument is TRUE if this BFD
|
||||
was created by the ELF backend linker. */
|
||||
void (*elf_backend_final_write_processing)
|
||||
(bfd *, bfd_boolean linker);
|
||||
before writing it out. */
|
||||
bfd_boolean (*elf_backend_final_write_processing)
|
||||
(bfd *);
|
||||
|
||||
/* This function is called by get_program_header_size. It should
|
||||
return the number of additional program segments which this BFD
|
||||
@ -2335,7 +2334,7 @@ extern struct bfd_link_hash_entry *bfd_elf_define_start_stop
|
||||
|
||||
extern void _bfd_elf_post_process_headers (bfd *, struct bfd_link_info *);
|
||||
|
||||
extern void _bfd_elf_final_write_processing (bfd *, bfd_boolean);
|
||||
extern bfd_boolean _bfd_elf_final_write_processing (bfd *);
|
||||
|
||||
extern const bfd_target *bfd_elf32_object_p
|
||||
(bfd *);
|
||||
|
@ -923,8 +923,8 @@ elf_hppa_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr, asection *sec)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
elf_hppa_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
elf_hppa_final_write_processing (bfd *abfd)
|
||||
{
|
||||
int mach = bfd_get_mach (abfd);
|
||||
|
||||
@ -947,7 +947,7 @@ elf_hppa_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
a step backwards with the ELF
|
||||
based toolchains. */
|
||||
| EF_PARISC_TRAPNIL);
|
||||
_bfd_elf_final_write_processing (abfd, linker);
|
||||
return _bfd_elf_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
/* Comparison function for qsort to sort unwind section during a
|
||||
|
@ -4667,8 +4667,8 @@ elf_mn10300_mach (flagword flags)
|
||||
file. This gets the MN10300 architecture right based on the machine
|
||||
number. */
|
||||
|
||||
static void
|
||||
_bfd_mn10300_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
_bfd_mn10300_elf_final_write_processing (bfd *abfd)
|
||||
{
|
||||
unsigned long val;
|
||||
|
||||
@ -4690,7 +4690,7 @@ _bfd_mn10300_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
|
||||
elf_elfheader (abfd)->e_flags &= ~ (EF_MN10300_MACH);
|
||||
elf_elfheader (abfd)->e_flags |= val;
|
||||
_bfd_elf_final_write_processing (abfd, linker);
|
||||
return _bfd_elf_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
static bfd_boolean
|
||||
|
@ -320,8 +320,8 @@ nacl_modify_program_headers (bfd *abfd, struct bfd_link_info *info)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
nacl_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
bfd_boolean
|
||||
nacl_final_write_processing (bfd *abfd)
|
||||
{
|
||||
struct elf_segment_map *seg;
|
||||
for (seg = elf_seg_map (abfd); seg != NULL; seg = seg->next)
|
||||
@ -354,5 +354,5 @@ nacl_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
|
||||
free (fill);
|
||||
}
|
||||
_bfd_elf_final_write_processing (abfd, linker);
|
||||
return _bfd_elf_final_write_processing (abfd);
|
||||
}
|
||||
|
@ -18,4 +18,4 @@
|
||||
|
||||
bfd_boolean nacl_modify_segment_map (bfd *, struct bfd_link_info *);
|
||||
bfd_boolean nacl_modify_program_headers (bfd *, struct bfd_link_info *);
|
||||
void nacl_final_write_processing (bfd *, bfd_boolean linker);
|
||||
bfd_boolean nacl_final_write_processing (bfd *);
|
||||
|
@ -212,8 +212,8 @@ elf_vxworks_emit_relocs (bfd *output_bfd,
|
||||
|
||||
/* 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)
|
||||
bfd_boolean
|
||||
elf_vxworks_final_write_processing (bfd *abfd)
|
||||
{
|
||||
asection * sec;
|
||||
struct bfd_elf_section_data *d;
|
||||
@ -229,7 +229,7 @@ elf_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
if (sec)
|
||||
d->this_hdr.sh_info = elf_section_data (sec)->this_idx;
|
||||
}
|
||||
_bfd_elf_final_write_processing (abfd, linker);
|
||||
return _bfd_elf_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
/* Add the dynamic entries required by VxWorks. These point to the
|
||||
|
@ -28,7 +28,7 @@ bfd_boolean elf_vxworks_link_output_symbol_hook
|
||||
bfd_boolean elf_vxworks_emit_relocs
|
||||
(bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *,
|
||||
struct elf_link_hash_entry **);
|
||||
void elf_vxworks_final_write_processing (bfd *, bfd_boolean);
|
||||
bfd_boolean elf_vxworks_final_write_processing (bfd *);
|
||||
bfd_boolean elf_vxworks_create_dynamic_sections
|
||||
(bfd *, struct bfd_link_info *, asection **);
|
||||
bfd_boolean elf_vxworks_add_dynamic_entries (bfd *, struct bfd_link_info *);
|
||||
|
29
bfd/elf.c
29
bfd/elf.c
@ -6568,7 +6568,8 @@ _bfd_elf_write_object_contents (bfd *abfd)
|
||||
|| !_bfd_elf_strtab_emit (abfd, elf_shstrtab (abfd))))
|
||||
return FALSE;
|
||||
|
||||
(*bed->elf_backend_final_write_processing) (abfd, elf_linker (abfd));
|
||||
if (!(*bed->elf_backend_final_write_processing) (abfd))
|
||||
return FALSE;
|
||||
|
||||
if (!bed->s->write_shdrs_and_ehdr (abfd))
|
||||
return FALSE;
|
||||
@ -12123,9 +12124,8 @@ _bfd_elf_post_process_headers (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
_bfd_elf_final_write_processing (bfd *abfd,
|
||||
bfd_boolean linker ATTRIBUTE_UNUSED)
|
||||
bfd_boolean
|
||||
_bfd_elf_final_write_processing (bfd *abfd)
|
||||
{
|
||||
Elf_Internal_Ehdr *i_ehdrp; /* ELF file header, internal form. */
|
||||
|
||||
@ -12137,9 +12137,24 @@ _bfd_elf_final_write_processing (bfd *abfd,
|
||||
/* Set the osabi field to ELFOSABI_GNU if the binary contains
|
||||
SHF_GNU_MBIND sections or symbols of STT_GNU_IFUNC type or
|
||||
STB_GNU_UNIQUE binding. */
|
||||
if (i_ehdrp->e_ident[EI_OSABI] == ELFOSABI_NONE
|
||||
&& elf_tdata (abfd)->has_gnu_osabi)
|
||||
i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_GNU;
|
||||
if (elf_tdata (abfd)->has_gnu_osabi != 0)
|
||||
{
|
||||
if (i_ehdrp->e_ident[EI_OSABI] == ELFOSABI_NONE)
|
||||
i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_GNU;
|
||||
else if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_GNU
|
||||
&& i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_FREEBSD)
|
||||
{
|
||||
if (elf_tdata (abfd)->has_gnu_osabi & elf_gnu_osabi_mbind)
|
||||
_bfd_error_handler (_("GNU_MBIND section is unsupported"));
|
||||
if (elf_tdata (abfd)->has_gnu_osabi & elf_gnu_osabi_ifunc)
|
||||
_bfd_error_handler (_("symbol type STT_GNU_IFUNC is unsupported"));
|
||||
if (elf_tdata (abfd)->has_gnu_osabi & elf_gnu_osabi_unique)
|
||||
_bfd_error_handler (_("symbol binding STB_GNU_UNIQUE is unsupported"));
|
||||
bfd_set_error (bfd_error_bad_value);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1016,8 +1016,8 @@ arc_elf_object_p (bfd * abfd)
|
||||
/* The final processing done just before writing out an ARC ELF object file.
|
||||
This gets the ARC architecture right based on the machine number. */
|
||||
|
||||
static void
|
||||
arc_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
arc_elf_final_write_processing (bfd *abfd)
|
||||
{
|
||||
unsigned long emf;
|
||||
int osver = bfd_elf_get_obj_attr_int (abfd, OBJ_ATTR_PROC,
|
||||
@ -1043,7 +1043,7 @@ arc_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
e_flags |= E_ARC_OSABI_V3;
|
||||
|
||||
elf_elfheader (abfd)->e_flags |= e_flags;
|
||||
_bfd_elf_final_write_processing (abfd, linker);
|
||||
return _bfd_elf_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
#ifdef ARC_ENABLE_DEBUG
|
||||
|
@ -17915,16 +17915,16 @@ elf32_arm_reloc_type_class (const struct bfd_link_info *info ATTRIBUTE_UNUSED,
|
||||
}
|
||||
|
||||
static void
|
||||
arm_final_write_processing (bfd *abfd, bfd_boolean linker ATTRIBUTE_UNUSED)
|
||||
arm_final_write_processing (bfd *abfd)
|
||||
{
|
||||
bfd_arm_update_notes (abfd, ARM_NOTE_SECTION);
|
||||
}
|
||||
|
||||
static void
|
||||
elf32_arm_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
elf32_arm_final_write_processing (bfd *abfd)
|
||||
{
|
||||
arm_final_write_processing (abfd, linker);
|
||||
_bfd_elf_final_write_processing (abfd, linker);
|
||||
arm_final_write_processing (abfd);
|
||||
return _bfd_elf_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
/* Return TRUE if this is an unwinding table entry. */
|
||||
@ -20600,11 +20600,11 @@ elf32_arm_nacl_modify_segment_map (bfd *abfd, struct bfd_link_info *info)
|
||||
&& nacl_modify_segment_map (abfd, info));
|
||||
}
|
||||
|
||||
static void
|
||||
elf32_arm_nacl_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
elf32_arm_nacl_final_write_processing (bfd *abfd)
|
||||
{
|
||||
arm_final_write_processing (abfd, linker);
|
||||
nacl_final_write_processing (abfd, linker);
|
||||
arm_final_write_processing (abfd);
|
||||
return nacl_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
static bfd_vma
|
||||
@ -20755,11 +20755,11 @@ elf32_arm_vxworks_link_hash_table_create (bfd *abfd)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
elf32_arm_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
elf32_arm_vxworks_final_write_processing (bfd *abfd)
|
||||
{
|
||||
arm_final_write_processing (abfd, linker);
|
||||
elf_vxworks_final_write_processing (abfd, linker);
|
||||
arm_final_write_processing (abfd);
|
||||
return elf_vxworks_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
#undef elf32_bed
|
||||
|
@ -1536,8 +1536,8 @@ elf32_avr_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
|
||||
file. This gets the AVR architecture right based on the machine
|
||||
number. */
|
||||
|
||||
static void
|
||||
bfd_elf_avr_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
bfd_elf_avr_final_write_processing (bfd *abfd)
|
||||
{
|
||||
unsigned long val;
|
||||
|
||||
@ -1620,7 +1620,7 @@ bfd_elf_avr_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
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);
|
||||
return _bfd_elf_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
/* Set the right machine number. */
|
||||
|
@ -1133,14 +1133,14 @@ bfd_boolean elf32_bfin_code_in_l1 = 0;
|
||||
/* Set by ld emulation if --data-in-l1. */
|
||||
bfd_boolean elf32_bfin_data_in_l1 = 0;
|
||||
|
||||
static void
|
||||
elf32_bfin_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
elf32_bfin_final_write_processing (bfd *abfd)
|
||||
{
|
||||
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 _bfd_elf_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
/* Return TRUE if the name is a local label.
|
||||
|
@ -1673,8 +1673,8 @@ elf_cr16_mach (flagword flags)
|
||||
file. This gets the CR16 architecture right based on the machine
|
||||
number. */
|
||||
|
||||
static void
|
||||
_bfd_cr16_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
_bfd_cr16_elf_final_write_processing (bfd *abfd)
|
||||
{
|
||||
unsigned long val;
|
||||
switch (bfd_get_mach (abfd))
|
||||
@ -1684,8 +1684,8 @@ _bfd_cr16_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
val = EM_CR16;
|
||||
break;
|
||||
}
|
||||
elf_elfheader (abfd)->e_flags |= val;
|
||||
_bfd_elf_final_write_processing (abfd, linker);
|
||||
elf_elfheader (abfd)->e_flags |= val;
|
||||
return _bfd_elf_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
|
||||
|
@ -3829,8 +3829,8 @@ cris_elf_object_p (bfd *abfd)
|
||||
/* Mark presence or absence of leading underscore. Set machine type
|
||||
flags from mach type. */
|
||||
|
||||
static void
|
||||
cris_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
cris_elf_final_write_processing (bfd *abfd)
|
||||
{
|
||||
unsigned long e_flags = elf_elfheader (abfd)->e_flags;
|
||||
|
||||
@ -3858,7 +3858,7 @@ cris_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
}
|
||||
|
||||
elf_elfheader (abfd)->e_flags = e_flags;
|
||||
_bfd_elf_final_write_processing (abfd, linker);
|
||||
return _bfd_elf_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
/* Set the mach type from e_flags value. */
|
||||
|
@ -583,8 +583,8 @@ elf32_h8_mach (flagword flags)
|
||||
file. We use this opportunity to encode the BFD machine type
|
||||
into the flags field in the object file. */
|
||||
|
||||
static void
|
||||
elf32_h8_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
elf32_h8_final_write_processing (bfd *abfd)
|
||||
{
|
||||
unsigned long val;
|
||||
|
||||
@ -622,7 +622,7 @@ elf32_h8_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
|
||||
elf_elfheader (abfd)->e_flags &= ~ (EF_H8_MACH);
|
||||
elf_elfheader (abfd)->e_flags |= val;
|
||||
_bfd_elf_final_write_processing (abfd, linker);
|
||||
return _bfd_elf_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
/* Return nonzero if ABFD represents a valid H8 ELF object file; also
|
||||
|
@ -555,8 +555,8 @@ lm32_elf_object_p (bfd *abfd)
|
||||
|
||||
/* Set machine type flags just before file is written out. */
|
||||
|
||||
static void
|
||||
lm32_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
lm32_elf_final_write_processing (bfd *abfd)
|
||||
{
|
||||
elf_elfheader (abfd)->e_machine = EM_LATTICEMICO32;
|
||||
elf_elfheader (abfd)->e_flags &=~ EF_LM32_MACH;
|
||||
@ -568,7 +568,7 @@ lm32_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
default:
|
||||
abort ();
|
||||
}
|
||||
_bfd_elf_final_write_processing (abfd, linker);
|
||||
return _bfd_elf_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
/* Set the GP value for OUTPUT_BFD. Returns FALSE if this is a
|
||||
|
@ -3403,8 +3403,8 @@ m32r_elf_object_p (bfd *abfd)
|
||||
|
||||
/* Store the machine number in the flags field. */
|
||||
|
||||
static void
|
||||
m32r_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
m32r_elf_final_write_processing (bfd *abfd)
|
||||
{
|
||||
unsigned long val;
|
||||
|
||||
@ -3418,7 +3418,7 @@ m32r_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
|
||||
elf_elfheader (abfd)->e_flags &=~ EF_M32R_ARCH;
|
||||
elf_elfheader (abfd)->e_flags |= val;
|
||||
_bfd_elf_final_write_processing (abfd, linker);
|
||||
return _bfd_elf_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
/* Function to keep M32R specific file flags. */
|
||||
|
@ -1053,8 +1053,8 @@ elf32_m68k_object_p (bfd *abfd)
|
||||
/* Somewhat reverse of elf32_m68k_object_p, this sets the e_flag
|
||||
field based on the machine number. */
|
||||
|
||||
static void
|
||||
elf_m68k_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
elf_m68k_final_write_processing (bfd *abfd)
|
||||
{
|
||||
int mach = bfd_get_mach (abfd);
|
||||
unsigned long e_flags = elf_elfheader (abfd)->e_flags;
|
||||
@ -1107,7 +1107,7 @@ elf_m68k_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
}
|
||||
elf_elfheader (abfd)->e_flags = e_flags;
|
||||
}
|
||||
_bfd_elf_final_write_processing (abfd, linker);
|
||||
return _bfd_elf_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
/* Keep m68k-specific flags in the ELF header. */
|
||||
|
@ -2643,11 +2643,11 @@ static const struct ecoff_debug_swap mips_elf32_ecoff_debug_swap = {
|
||||
#include "elf32-target.h"
|
||||
/* Implement elf_backend_final_write_processing for VxWorks. */
|
||||
|
||||
static void
|
||||
mips_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
mips_vxworks_final_write_processing (bfd *abfd)
|
||||
{
|
||||
_bfd_mips_final_write_processing (abfd, linker);
|
||||
elf_vxworks_final_write_processing (abfd, linker);
|
||||
_bfd_mips_final_write_processing (abfd);
|
||||
return elf_vxworks_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
#undef TARGET_LITTLE_SYM
|
||||
|
@ -1385,8 +1385,8 @@ elf32_msp430_relocate_section (bfd * output_bfd ATTRIBUTE_UNUSED,
|
||||
file. This gets the MSP430 architecture right based on the machine
|
||||
number. */
|
||||
|
||||
static void
|
||||
bfd_elf_msp430_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
bfd_elf_msp430_final_write_processing (bfd *abfd)
|
||||
{
|
||||
unsigned long val;
|
||||
|
||||
@ -1421,7 +1421,7 @@ bfd_elf_msp430_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
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);
|
||||
return _bfd_elf_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
/* Set the right machine number. */
|
||||
|
@ -6672,8 +6672,8 @@ nds32_elf_object_p (bfd *abfd)
|
||||
|
||||
/* Store the machine number in the flags field. */
|
||||
|
||||
static void
|
||||
nds32_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
nds32_elf_final_write_processing (bfd *abfd)
|
||||
{
|
||||
unsigned long val;
|
||||
static unsigned int cur_mach = 0;
|
||||
@ -6710,7 +6710,7 @@ nds32_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
|
||||
elf_elfheader (abfd)->e_flags &= ~EF_NDS_ARCH;
|
||||
elf_elfheader (abfd)->e_flags |= val;
|
||||
_bfd_elf_final_write_processing (abfd, linker);
|
||||
return _bfd_elf_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
/* Function to keep NDS32 specific file flags. */
|
||||
|
@ -3156,8 +3156,8 @@ or1k_elf_object_p (bfd *abfd)
|
||||
|
||||
/* Store the machine number in the flags field. */
|
||||
|
||||
static void
|
||||
or1k_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
or1k_elf_final_write_processing (bfd *abfd)
|
||||
{
|
||||
switch (bfd_get_mach (abfd))
|
||||
{
|
||||
@ -3168,7 +3168,7 @@ or1k_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
elf_elfheader (abfd)->e_flags |= EF_OR1K_NODELAY;
|
||||
break;
|
||||
}
|
||||
_bfd_elf_final_write_processing (abfd, linker);
|
||||
return _bfd_elf_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
static bfd_boolean
|
||||
|
@ -336,12 +336,12 @@ pj_elf_info_to_howto (bfd *abfd,
|
||||
/* Take this moment to fill in the special picoJava bits in the
|
||||
e_flags field. */
|
||||
|
||||
static void
|
||||
pj_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
pj_elf_final_write_processing (bfd *abfd)
|
||||
{
|
||||
elf_elfheader (abfd)->e_flags |= EF_PICOJAVA_ARCH;
|
||||
elf_elfheader (abfd)->e_flags |= EF_PICOJAVA_GNUCALLS;
|
||||
_bfd_elf_final_write_processing (abfd, linker);
|
||||
return _bfd_elf_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
#define TARGET_BIG_SYM pj_elf32_vec
|
||||
|
@ -1705,7 +1705,7 @@ ppc_elf_write_section (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
/* Finally we can generate the output section. */
|
||||
|
||||
static void
|
||||
ppc_final_write_processing (bfd *abfd, bfd_boolean linker ATTRIBUTE_UNUSED)
|
||||
ppc_final_write_processing (bfd *abfd)
|
||||
{
|
||||
bfd_byte *buffer;
|
||||
asection *asec;
|
||||
@ -1757,11 +1757,11 @@ ppc_final_write_processing (bfd *abfd, bfd_boolean linker ATTRIBUTE_UNUSED)
|
||||
apuinfo_list_finish ();
|
||||
}
|
||||
|
||||
static void
|
||||
ppc_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
ppc_elf_final_write_processing (bfd *abfd)
|
||||
{
|
||||
ppc_final_write_processing (abfd, linker);
|
||||
_bfd_elf_final_write_processing (abfd, linker);
|
||||
ppc_final_write_processing (abfd);
|
||||
return _bfd_elf_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
static bfd_boolean
|
||||
@ -10494,11 +10494,11 @@ ppc_elf_vxworks_add_symbol_hook (bfd *abfd,
|
||||
return ppc_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp);
|
||||
}
|
||||
|
||||
static void
|
||||
ppc_elf_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
ppc_elf_vxworks_final_write_processing (bfd *abfd)
|
||||
{
|
||||
ppc_final_write_processing (abfd, linker);
|
||||
elf_vxworks_final_write_processing (abfd, linker);
|
||||
ppc_final_write_processing (abfd);
|
||||
return elf_vxworks_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
/* On VxWorks, we emit relocations against _PROCEDURE_LINKAGE_TABLE_, so
|
||||
|
@ -117,7 +117,7 @@ elf32_sparc_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
|
||||
We need to set the e_machine field appropriately. */
|
||||
|
||||
static void
|
||||
sparc_final_write_processing (bfd *abfd, bfd_boolean linker ATTRIBUTE_UNUSED)
|
||||
sparc_final_write_processing (bfd *abfd)
|
||||
{
|
||||
switch (bfd_get_mach (abfd))
|
||||
{
|
||||
@ -156,11 +156,11 @@ sparc_final_write_processing (bfd *abfd, bfd_boolean linker ATTRIBUTE_UNUSED)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
elf32_sparc_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
elf32_sparc_final_write_processing (bfd *abfd)
|
||||
{
|
||||
sparc_final_write_processing (abfd, linker);
|
||||
_bfd_elf_final_write_processing (abfd, linker);
|
||||
sparc_final_write_processing (abfd);
|
||||
return _bfd_elf_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
/* Used to decide how to sort relocs in an optimal manner for the
|
||||
@ -327,11 +327,11 @@ elf32_sparc_vxworks_link_hash_table_create (bfd *abfd)
|
||||
/* A final_write_processing hook that does both the SPARC- and VxWorks-
|
||||
specific handling. */
|
||||
|
||||
static void
|
||||
elf32_sparc_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
elf32_sparc_vxworks_final_write_processing (bfd *abfd)
|
||||
{
|
||||
sparc_final_write_processing (abfd, linker);
|
||||
elf_vxworks_final_write_processing (abfd, linker);
|
||||
sparc_final_write_processing (abfd);
|
||||
return elf_vxworks_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
#undef TARGET_BIG_SYM
|
||||
|
@ -2718,8 +2718,8 @@ v850_elf_object_p (bfd *abfd)
|
||||
|
||||
/* Store the machine number in the flags field. */
|
||||
|
||||
static void
|
||||
v850_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
v850_elf_final_write_processing (bfd *abfd)
|
||||
{
|
||||
unsigned long val;
|
||||
|
||||
@ -2749,7 +2749,7 @@ v850_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
_bfd_elf_final_write_processing (abfd, linker);
|
||||
return _bfd_elf_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
/* Function to keep V850 specific file flags. */
|
||||
|
@ -416,8 +416,8 @@ elf32_xc16x_relocate_section (bfd *output_bfd,
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
elf32_xc16x_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
elf32_xc16x_final_write_processing (bfd *abfd)
|
||||
{
|
||||
unsigned long val;
|
||||
|
||||
@ -438,7 +438,7 @@ elf32_xc16x_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
}
|
||||
|
||||
elf_elfheader (abfd)->e_flags |= val;
|
||||
_bfd_elf_final_write_processing (abfd, linker);
|
||||
return _bfd_elf_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
static unsigned long
|
||||
|
@ -3462,8 +3462,8 @@ elf_xtensa_object_p (bfd *abfd)
|
||||
file. This gets the Xtensa architecture right based on the machine
|
||||
number. */
|
||||
|
||||
static void
|
||||
elf_xtensa_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
elf_xtensa_final_write_processing (bfd *abfd)
|
||||
{
|
||||
int mach;
|
||||
unsigned long val = elf_elfheader (abfd)->e_flags & EF_XTENSA_MACH;
|
||||
@ -3479,7 +3479,7 @@ elf_xtensa_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
|
||||
elf_elfheader (abfd)->e_flags &= ~EF_XTENSA_MACH;
|
||||
elf_elfheader (abfd)->e_flags |= val;
|
||||
_bfd_elf_final_write_processing (abfd, linker);
|
||||
return _bfd_elf_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
|
||||
|
@ -4659,8 +4659,8 @@ elf64_vms_section_processing (bfd *abfd ATTRIBUTE_UNUSED,
|
||||
/* The final processing done just before writing out a VMS IA-64 ELF
|
||||
object file. */
|
||||
|
||||
static void
|
||||
elf64_vms_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
elf64_vms_final_write_processing (bfd *abfd)
|
||||
{
|
||||
Elf_Internal_Shdr *hdr;
|
||||
asection *s;
|
||||
@ -4695,7 +4695,7 @@ elf64_vms_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
elf_elfheader (abfd)->e_flags = flags;
|
||||
elf_flags_init (abfd) = TRUE;
|
||||
}
|
||||
_bfd_elf_final_write_processing (abfd, linker);
|
||||
return _bfd_elf_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
static bfd_boolean
|
||||
|
@ -1002,8 +1002,8 @@ elfNN_ia64_fake_sections (bfd *abfd, Elf_Internal_Shdr *hdr,
|
||||
/* The final processing done just before writing out an IA-64 ELF
|
||||
object file. */
|
||||
|
||||
static void
|
||||
elfNN_ia64_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
static bfd_boolean
|
||||
elfNN_ia64_final_write_processing (bfd *abfd)
|
||||
{
|
||||
Elf_Internal_Shdr *hdr;
|
||||
asection *s;
|
||||
@ -1035,7 +1035,7 @@ elfNN_ia64_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
elf_elfheader(abfd)->e_flags = flags;
|
||||
elf_flags_init (abfd) = TRUE;
|
||||
}
|
||||
_bfd_elf_final_write_processing (abfd, linker);
|
||||
return _bfd_elf_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
/* Hook called by the linker routine which adds symbols from an object
|
||||
|
@ -12358,8 +12358,7 @@ _bfd_mips_elf_sort_relocs_p (asection *sec)
|
||||
number. This is used by both the 32-bit and the 64-bit ABI. */
|
||||
|
||||
void
|
||||
_bfd_mips_final_write_processing (bfd *abfd,
|
||||
bfd_boolean linker ATTRIBUTE_UNUSED)
|
||||
_bfd_mips_final_write_processing (bfd *abfd)
|
||||
{
|
||||
unsigned int i;
|
||||
Elf_Internal_Shdr **hdrpp;
|
||||
@ -12439,11 +12438,11 @@ _bfd_mips_final_write_processing (bfd *abfd,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
_bfd_mips_elf_final_write_processing (bfd *abfd, bfd_boolean linker)
|
||||
bfd_boolean
|
||||
_bfd_mips_elf_final_write_processing (bfd *abfd)
|
||||
{
|
||||
_bfd_mips_final_write_processing (abfd, linker);
|
||||
_bfd_elf_final_write_processing (abfd, linker);
|
||||
_bfd_mips_final_write_processing (abfd);
|
||||
return _bfd_elf_final_write_processing (abfd);
|
||||
}
|
||||
|
||||
/* When creating an IRIX5 executable, we need REGINFO and RTPROC
|
||||
|
@ -70,9 +70,9 @@ extern bfd_boolean _bfd_mips_elf_finish_dynamic_sections
|
||||
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);
|
||||
(bfd *);
|
||||
extern bfd_boolean _bfd_mips_elf_final_write_processing
|
||||
(bfd *);
|
||||
extern int _bfd_mips_elf_additional_program_headers
|
||||
(bfd *, struct bfd_link_info *);
|
||||
extern bfd_boolean _bfd_mips_elf_modify_segment_map
|
||||
|
@ -1,3 +1,9 @@
|
||||
2019-07-24 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* config/obj-elf.c (obj_elf_section, obj_elf_type): Set has_gnu_osabi.
|
||||
* testsuite/gas/elf/section12a.d: Update xfails.
|
||||
* testsuite/gas/elf/section12b.d: Likewise.
|
||||
|
||||
2019-07-24 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* testsuite/gas/elf/section12a.d: xfail visium and cloudabi.
|
||||
|
@ -1242,6 +1242,7 @@ done:
|
||||
&& bed->elf_osabi != ELFOSABI_FREEBSD)
|
||||
as_bad (_("GNU_MBIND section is supported only by GNU "
|
||||
"and FreeBSD targets"));
|
||||
elf_tdata (stdoutput)->has_gnu_osabi |= elf_gnu_osabi_mbind;
|
||||
}
|
||||
elf_section_flags (now_seg) |= gnu_attr;
|
||||
|
||||
@ -2060,6 +2061,7 @@ obj_elf_type (int ignore ATTRIBUTE_UNUSED)
|
||||
&& bed->elf_osabi != ELFOSABI_FREEBSD)
|
||||
as_bad (_("symbol type \"%s\" is supported only by GNU "
|
||||
"and FreeBSD targets"), type_name);
|
||||
elf_tdata (stdoutput)->has_gnu_osabi |= elf_gnu_osabi_ifunc;
|
||||
type = BSF_FUNCTION | BSF_GNU_INDIRECT_FUNCTION;
|
||||
}
|
||||
else if (strcmp (type_name, "gnu_unique_object") == 0)
|
||||
@ -2072,6 +2074,7 @@ obj_elf_type (int ignore ATTRIBUTE_UNUSED)
|
||||
else if (bed->elf_osabi != ELFOSABI_GNU)
|
||||
as_bad (_("symbol type \"%s\" is supported only by GNU targets"),
|
||||
type_name);
|
||||
elf_tdata (stdoutput)->has_gnu_osabi |= elf_gnu_osabi_unique;
|
||||
type = BSF_OBJECT | BSF_GNU_UNIQUE;
|
||||
}
|
||||
#ifdef md_elf_symbol_type
|
||||
|
@ -3,7 +3,7 @@
|
||||
#readelf: -Sg --wide
|
||||
#name: mbind sections
|
||||
# A number of targets do not support SHF_GNU_MBIND
|
||||
#xfail: msp430-*-* visium-*-*
|
||||
#xfail: arm*-*-netbsdelf* arm*-*-nto* msp430-*-* visium-*-*
|
||||
#xfail: *-*-hpux* *-*-cloudabi
|
||||
|
||||
#...
|
||||
|
@ -6,7 +6,7 @@
|
||||
# expected below.
|
||||
#xfail: rx-*-*
|
||||
# A number of targets do not support SHF_GNU_MBIND
|
||||
#xfail: msp430-*-* visium-*-*
|
||||
#xfail: arm*-*-netbsdelf* arm*-*-nto* msp430-*-* visium-*-*
|
||||
#xfail: *-*-hpux* *-*-cloudabi
|
||||
|
||||
#...
|
||||
|
Loading…
x
Reference in New Issue
Block a user