diff options
author | Alan Modra <amodra@gmail.com> | 2016-09-26 18:04:57 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2016-09-26 18:04:57 +0930 |
commit | 005d79fd6101dae0aaf62a1b0cee399efcbd0e21 (patch) | |
tree | 4035e4a8d7549d7b66bd522e41b9f238202b8131 /gas | |
parent | [GOLD] regen testsuite/Makefile.in (diff) | |
download | binutils-gdb-005d79fd6101dae0aaf62a1b0cee399efcbd0e21.tar.gz binutils-gdb-005d79fd6101dae0aaf62a1b0cee399efcbd0e21.tar.bz2 binutils-gdb-005d79fd6101dae0aaf62a1b0cee399efcbd0e21.zip |
PowerPC .gnu.attributes
This patch extends Tag_GNU_Power_ABI_FP to cover long double ABIs,
makes the assembler warn about undefined tag values, and removes
similar warnings from the linker. I think it is better to not
warn in the linker about undefined tag values as future extensions to
the tags then won't result in likely bogus warnings. This is
consistent with the fact that an older linker won't warn on an
entirely new tag.
include/
* elf/ppc.h (Tag_GNU_Power_ABI_FP): Comment.
bfd/
* elf-bfd.h (_bfd_elf_ppc_merge_fp_attributes): Declare.
* elf32-ppc.c (_bfd_elf_ppc_merge_fp_attributes): New function.
(ppc_elf_merge_obj_attributes): Use it. Don't copy first file
attributes, merge them. Don't warn about undefined tag bits,
or copy unknown values to output.
* elf64-ppc.c (ppc64_elf_merge_private_bfd_data): Call
_bfd_elf_ppc_merge_fp_attributes.
binutils/
* readelf.c (display_power_gnu_attribute): Catch truncated section
for all powerpc attributes. Display long double ABI. Don't
capitalize words, except for names. Show known bits of tag values
when some unknown bits are present. Whitespace fixes.
gas/
* config/tc-ppc.c (ppc_elf_gnu_attribute): New function.
(md_pseudo_table <ELF>): Handle "gnu_attribute".
ld/
* testsuite/ld-powerpc/attr-gnu-4-4.s: Delete.
* testsuite/ld-powerpc/attr-gnu-4-14.d: Delete.
* testsuite/ld-powerpc/attr-gnu-4-24.d: Delete.
* testsuite/ld-powerpc/attr-gnu-4-34.d: Delete.
* testsuite/ld-powerpc/attr-gnu-4-41.d: Delete.
* testsuite/ld-powerpc/attr-gnu-4-32.d: Adjust expected warning.
* testsuite/ld-powerpc/attr-gnu-8-23.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-01.d: Adjust expected output.
* testsuite/ld-powerpc/attr-gnu-4-02.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-03.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-10.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-11.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-20.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-22.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-33.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-8-11.d: Likewise.
* testsuite/ld-powerpc/powerpc.exp: Don't run deleted tests.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 5 | ||||
-rw-r--r-- | gas/config/tc-ppc.c | 24 |
2 files changed, 29 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 408a2872713..f5f22989433 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2016-09-26 Alan Modra <amodra@gmail.com> + + * config/tc-ppc.c (ppc_elf_gnu_attribute): New function. + (md_pseudo_table <ELF>): Handle "gnu_attribute". + 2016-09-22 Thomas Preud'homme <thomas.preudhomme@arm.com> * config/tc-arm.c (v7m_psrs): Remove BASEPRI_MASK MRS/MSR special diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index 1417c266cd5..d2b53169804 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -133,6 +133,7 @@ static void ppc_elf_rdata (int); static void ppc_elf_lcomm (int); static void ppc_elf_localentry (int); static void ppc_elf_abiversion (int); +static void ppc_elf_gnu_attribute (int); #endif #ifdef TE_PE @@ -270,6 +271,7 @@ const pseudo_typeS md_pseudo_table[] = { "lcomm", ppc_elf_lcomm, 0 }, { "localentry", ppc_elf_localentry, 0 }, { "abiversion", ppc_elf_abiversion, 0 }, + { "gnu_attribute", ppc_elf_gnu_attribute, 0}, #endif #ifdef TE_PE @@ -2314,6 +2316,28 @@ ppc_elf_abiversion (int ignore ATTRIBUTE_UNUSED) demand_empty_rest_of_line (); } +/* Parse a .gnu_attribute directive. */ +static void +ppc_elf_gnu_attribute (int ignored ATTRIBUTE_UNUSED) +{ + int tag = obj_elf_vendor_attribute (OBJ_ATTR_GNU); + + /* Check validity of defined powerpc tags. */ + if (tag == Tag_GNU_Power_ABI_FP + || tag == Tag_GNU_Power_ABI_Vector + || tag == Tag_GNU_Power_ABI_Struct_Return) + { + unsigned int val; + + val = bfd_elf_get_obj_attr_int (stdoutput, OBJ_ATTR_GNU, tag); + + if ((tag == Tag_GNU_Power_ABI_FP && val > 15) + || (tag == Tag_GNU_Power_ABI_Vector && val > 3) + || (tag == Tag_GNU_Power_ABI_Struct_Return && val > 2)) + as_warn (_("unknown .gnu_attribute value")); + } +} + /* Set ABI version in output file. */ void ppc_elf_end (void) |