From 85f7484a3a1921649029c4a4fcf3247c3f3bc13c Mon Sep 17 00:00:00 2001 From: Pat Bernardi Date: Thu, 25 Jun 2020 16:05:38 -0400 Subject: m68k: tag floating-point ABI used This patch adds GNU attribute support to m68k and utilises it to tag the floating-point calling convention used (hard-float or soft-float). It enables the linker to ensure linked objects use a consistent floating-point ABI and allows tools like GDB to infer the ABI used from the ELF file. It is based on similar work done for PowerPC. bfd/ * elf32-m68k.c (m68k_elf_merge_obj_attributes): New function. (elf32_m68k_merge_private_bfd_data): Merge GNU attributes. binutils/ * readelf.c (display_m68k_gnu_attribute): New function. (process_arch_specific): Call display_m68k_gnu_attribute for EM_68K. gas/ * config/tc-m68k.c (m68k_elf_gnu_attribute): New function. (md_pseudo_table): Handle "gnu_attribute". * doc/as.texi: Document GNU attribute for M68K. include/ * elf/m68k.h: Add enum for GNU object attribute with floating point tag name and values. ld/ * testsuite/ld-m68k/attr-gnu-4-0.s: New file. * testsuite/ld-m68k/attr-gnu-4-1.s: Likewise. * testsuite/ld-m68k/attr-gnu-4-2.s: Likewise. * testsuite/ld-m68k/attr-gnu-4-00.d: Likewise. * testsuite/ld-m68k/attr-gnu-4-01.d: Likewise. * testsuite/ld-m68k/attr-gnu-4-02.d: Likewise. * testsuite/ld-m68k/attr-gnu-4-10.d: Likewise. * testsuite/ld-m68k/attr-gnu-4-11.d: Likewise. * testsuite/ld-m68k/attr-gnu-4-12.d: Likewise. * testsuite/ld-m68k/attr-gnu-4-20.d: Likewise. * testsuite/ld-m68k/attr-gnu-4-21.d: Likewise. * testsuite/ld-m68k/attr-gnu-4-22.d: Likewise. * testsuite/ld-m68k/m68k.exp: Run the new tests. --- include/ChangeLog | 5 +++++ include/elf/m68k.h | 14 +++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/ChangeLog b/include/ChangeLog index 8e06abf..ab6d753 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,8 @@ +2020-06-26 Pat Bernardi + + * elf/m68k.h: Add enum for GNU object attribute with floating point + tag name and values. + 2020-06-25 Nick Clifton * libiberty.h (bsearch_r): Remove use of the register keyword from diff --git a/include/elf/m68k.h b/include/elf/m68k.h index 2d3c12e..e5b0592 100644 --- a/include/elf/m68k.h +++ b/include/elf/m68k.h @@ -97,5 +97,17 @@ END_RELOC_NUMBERS (R_68K_max) #define EF_M68K_CF_EMAC_B 0x30 /* EMAC_B */ #define EF_M68K_CF_FLOAT 0x40 /* Has float insns */ #define EF_M68K_CF_MASK 0xFF - + +/* GNU object attribute tags. */ +enum +{ + /* 0-3 are generic. */ + + /* FP ABI, low 2 bits: + 1 for double precision hard-float, + 2 for soft-float, + 0 for not tagged or not using any ABIs affected by the differences. */ + Tag_GNU_M68K_ABI_FP = 4, +}; + #endif -- cgit v1.1