diff options
author | Andrew Stubbs <andrew.stubbs@st.com> | 2009-01-26 14:36:43 +0000 |
---|---|---|
committer | Andrew Stubbs <andrew.stubbs@st.com> | 2009-01-26 14:36:43 +0000 |
commit | ee3c0378c3af1a2a248430691635a46663cc9976 (patch) | |
tree | 80a0aceb16916d6e30bc36b407878b235d801362 /gas/config | |
parent | 17f4880d2fc4a2758951631692072c9fb0147301 (diff) | |
download | gdb-ee3c0378c3af1a2a248430691635a46663cc9976.zip gdb-ee3c0378c3af1a2a248430691635a46663cc9976.tar.gz gdb-ee3c0378c3af1a2a248430691635a46663cc9976.tar.bz2 |
2009-01-26 Andrew Stubbs <ams@codesourcery.com>
gas/
* config/tc-arm.c (attributes_set_explicitly): New array.
(s_arm_eabi_attribute): Check return value from s_vendor_attribute.
(cpu_arch): Add ARM_ARCH_V5T.
(aeabi_set_attribute_int): New function.
(aeabi_set_attribute_string): New function.
(aeabi_set_public_attributes): Set attributes according to the user's
intentions, rather than the actual state of the binary.
Use aeabi_set_attribute_int and aeabi_set_attribute_string instead of
bfd_elf_add_proc_attr_int and bfd_elf_add_proc_attr_string.
Support WMMXv2. Use attribute names instead of numbers.
* read.c (s_vendor_attribute): Change return type to int.
Return the tag number that was set.
* read.h (s_vendor_attribute): Change return type to int.
gas/testsuite/
* gas/arm/attr-cpu-directive.d: New file.
* gas/arm/attr-cpu-directive.s: New file.
* gas/arm/attr-default.d: New file.
* gas/arm/attr-march-all.d: New file.
* gas/arm/attr-march-armv1.d: New file.
* gas/arm/attr-march-armv2.d: New file.
* gas/arm/attr-march-armv2a.d: New file.
* gas/arm/attr-march-armv2s.d: New file.
* gas/arm/attr-march-armv3.d: New file.
* gas/arm/attr-march-armv3m.d: New file.
* gas/arm/attr-march-armv4.d: New file.
* gas/arm/attr-march-armv4t.d: New file.
* gas/arm/attr-march-armv4txm.d: New file.
* gas/arm/attr-march-armv4xm.d: New file.
* gas/arm/attr-march-armv5.d: New file.
* gas/arm/attr-march-armv5t.d: New file.
* gas/arm/attr-march-armv5te.d: New file.
* gas/arm/attr-march-armv5tej.d: New file.
* gas/arm/attr-march-armv5texp.d: New file.
* gas/arm/attr-march-armv5txm.d: New file.
* gas/arm/attr-march-armv6-m.d: New file.
* gas/arm/attr-march-armv6.d: New file.
* gas/arm/attr-march-armv6j.d: New file.
* gas/arm/attr-march-armv6k.d: New file.
* gas/arm/attr-march-armv6kt2.d: New file.
* gas/arm/attr-march-armv6t2.d: New file.
* gas/arm/attr-march-armv6z.d: New file.
* gas/arm/attr-march-armv6zk.d: New file.
* gas/arm/attr-march-armv6zkt2.d: New file.
* gas/arm/attr-march-armv6zt2.d: New file.
* gas/arm/attr-march-armv7-a.d: New file.
* gas/arm/attr-march-armv7-m.d: New file.
* gas/arm/attr-march-armv7-r.d: New file.
* gas/arm/attr-march-armv7.d: New file.
* gas/arm/attr-march-armv7a.d: New file.
* gas/arm/attr-march-armv7m.d: New file.
* gas/arm/attr-march-armv7r.d: New file.
* gas/arm/attr-march-iwmmxt.d: New file.
* gas/arm/attr-march-iwmmxt2.d: New file.
* gas/arm/attr-march-xscale.d: New file.
* gas/arm/attr-mcpu.d: New file.
* gas/arm/attr-mfpu-arm1020e.d: New file.
* gas/arm/attr-mfpu-arm1020t.d: New file.
* gas/arm/attr-mfpu-arm1136jf-s.d: New file.
* gas/arm/attr-mfpu-arm1136jfs.d: New file.
* gas/arm/attr-mfpu-arm7500fe.d: New file.
* gas/arm/attr-mfpu-fpa.d: New file.
* gas/arm/attr-mfpu-fpa10.d: New file.
* gas/arm/attr-mfpu-fpa11.d: New file.
* gas/arm/attr-mfpu-fpe.d: New file.
* gas/arm/attr-mfpu-fpe2.d: New file.
* gas/arm/attr-mfpu-fpe3.d: New file.
* gas/arm/attr-mfpu-maverick.d: New file.
* gas/arm/attr-mfpu-neon-fp16.d: New file.
* gas/arm/attr-mfpu-neon.d: New file.
* gas/arm/attr-mfpu-softfpa.d: New file.
* gas/arm/attr-mfpu-softvfp+vfp.d: New file.
* gas/arm/attr-mfpu-softvfp.d: New file.
* gas/arm/attr-mfpu-vfp.d: New file.
* gas/arm/attr-mfpu-vfp10-r0.d: New file.
* gas/arm/attr-mfpu-vfp10.d: New file.
* gas/arm/attr-mfpu-vfp3.d: New file.
* gas/arm/attr-mfpu-vfp9.d: New file.
* gas/arm/attr-mfpu-vfpv2.d: New file.
* gas/arm/attr-mfpu-vfpv3-d16.d: New file.
* gas/arm/attr-mfpu-vfpv3.d: New file.
* gas/arm/attr-mfpu-vfpxd.d: New file.
* gas/arm/attr-order.d: Update Tag_ARM_ISA_use and Tag_THUMB_ISA_use.
* gas/arm/attr-override-cpu-directive.d: New file.
* gas/arm/attr-override-cpu-directive.s: New file.
* gas/arm/attr-override-mcpu.d: New file.
* gas/arm/attr-override-mcpu.s: New file.
* gas/arm/blank.s: New file.
* gas/arm/eabi_attr_1.d: Update Tag_ARM_ISA_use and Tag_THUMB_ISA_use.
ld/testsuite/
* ld-arm/attr-merge-3.attr: Update following gas change.
* ld-arm/attr-merge-2.attr: Update Tag_ARM_ISA_use and
Tag_THUMB_ISA_use following gas changes.
* ld-arm/attr-merge-4.attr: Likewise.
* ld-arm/attr-merge-5.attr: Likewise.
* ld-arm/attr-merge-arch-1.attr: Likewise.
* ld-arm/attr-merge-arch-2.attr: Likewise.
* ld-arm/attr-merge-unknown-2.d: Likewise.
* ld-arm/attr-merge-unknown-2r.d: Likewise.
* ld-arm/attr-merge-unknown-3.d: Likewise.
* ld-arm/attr-merge-wchar-00-nowarn.d: Likewise.
* ld-arm/attr-merge-wchar-00.d: Likewise.
* ld-arm/attr-merge-wchar-02-nowarn.d: Likewise.
* ld-arm/attr-merge-wchar-02.d: Likewise.
* ld-arm/attr-merge-wchar-04-nowarn.d: Likewise.
* ld-arm/attr-merge-wchar-04.d: Likewise.
* ld-arm/attr-merge-wchar-20-nowarn.d: Likewise.
* ld-arm/attr-merge-wchar-20.d: Likewise.
* ld-arm/attr-merge-wchar-22-nowarn.d: Likewise.
* ld-arm/attr-merge-wchar-22.d: Likewise.
* ld-arm/attr-merge-wchar-24-nowarn.d: Likewise.
* ld-arm/attr-merge-wchar-40-nowarn.d: Likewise.
* ld-arm/attr-merge-wchar-40.d: Likewise.
* ld-arm/attr-merge-wchar-42-nowarn.d: Likewise.
* ld-arm/attr-merge-wchar-44-nowarn.d: Likewise.
* ld-arm/attr-merge-wchar-44.d: Likewise.
* ld-arm/attr-merge.attr: Likewise.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-arm.c | 87 |
1 files changed, 55 insertions, 32 deletions
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 0cefbdb..e97e0a3 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -241,6 +241,8 @@ static int meabi_flags = EABI_DEFAULT; static int meabi_flags = EF_ARM_EABI_UNKNOWN; # endif +static int attributes_set_explicitly[NUM_KNOWN_OBJ_ATTRIBUTES]; + bfd_boolean arm_is_eabi (void) { @@ -3884,7 +3886,10 @@ s_arm_unwind_raw (int ignored ATTRIBUTE_UNUSED) static void s_arm_eabi_attribute (int ignored ATTRIBUTE_UNUSED) { - s_vendor_attribute (OBJ_ATTR_PROC); + int tag = s_vendor_attribute (OBJ_ATTR_PROC); + + if (tag < NUM_KNOWN_OBJ_ATTRIBUTES) + attributes_set_explicitly[tag] = 1; } #endif /* OBJ_ELF */ @@ -20716,6 +20721,7 @@ static const cpu_arch_ver_table cpu_arch_ver[] = {1, ARM_ARCH_V4}, {2, ARM_ARCH_V4T}, {3, ARM_ARCH_V5}, + {3, ARM_ARCH_V5T}, {4, ARM_ARCH_V5TE}, {5, ARM_ARCH_V5TEJ}, {6, ARM_ARCH_V6}, @@ -20729,6 +20735,25 @@ static const cpu_arch_ver_table cpu_arch_ver[] = {0, ARM_ARCH_NONE} }; +/* Set an attribute if it has not already been set by the user. */ +static void +aeabi_set_attribute_int (int tag, int value) +{ + if (tag < 1 + || tag >= NUM_KNOWN_OBJ_ATTRIBUTES + || !attributes_set_explicitly[tag]) + bfd_elf_add_proc_attr_int (stdoutput, tag, value); +} + +static void +aeabi_set_attribute_string (int tag, const char *value) +{ + if (tag < 1 + || tag >= NUM_KNOWN_OBJ_ATTRIBUTES + || !attributes_set_explicitly[tag]) + bfd_elf_add_proc_attr_string (stdoutput, tag, value); +} + /* Set the public EABI object attributes. */ static void aeabi_set_public_attributes (void) @@ -20775,49 +20800,47 @@ aeabi_set_public_attributes (void) for (i = 0; p[i]; i++) p[i] = TOUPPER (p[i]); } - bfd_elf_add_proc_attr_string (stdoutput, 5, p); + aeabi_set_attribute_string (Tag_CPU_name, p); } /* Tag_CPU_arch. */ - bfd_elf_add_proc_attr_int (stdoutput, 6, arch); + aeabi_set_attribute_int (Tag_CPU_arch, arch); /* Tag_CPU_arch_profile. */ if (ARM_CPU_HAS_FEATURE (flags, arm_ext_v7a)) - bfd_elf_add_proc_attr_int (stdoutput, 7, 'A'); + aeabi_set_attribute_int (Tag_CPU_arch_profile, 'A'); else if (ARM_CPU_HAS_FEATURE (flags, arm_ext_v7r)) - bfd_elf_add_proc_attr_int (stdoutput, 7, 'R'); + aeabi_set_attribute_int (Tag_CPU_arch_profile, 'R'); else if (ARM_CPU_HAS_FEATURE (flags, arm_ext_m)) - bfd_elf_add_proc_attr_int (stdoutput, 7, 'M'); + aeabi_set_attribute_int (Tag_CPU_arch_profile, 'M'); /* Tag_ARM_ISA_use. */ - if (ARM_CPU_HAS_FEATURE (arm_arch_used, arm_arch_full)) - bfd_elf_add_proc_attr_int (stdoutput, 8, 1); + if (ARM_CPU_HAS_FEATURE (flags, arm_ext_v1) + || arch == 0) + aeabi_set_attribute_int (Tag_ARM_ISA_use, 1); /* Tag_THUMB_ISA_use. */ - if (ARM_CPU_HAS_FEATURE (thumb_arch_used, arm_arch_full)) - bfd_elf_add_proc_attr_int (stdoutput, 9, - ARM_CPU_HAS_FEATURE (thumb_arch_used, arm_arch_t2) ? 2 : 1); + if (ARM_CPU_HAS_FEATURE (flags, arm_ext_v4t) + || arch == 0) + aeabi_set_attribute_int (Tag_THUMB_ISA_use, + ARM_CPU_HAS_FEATURE (flags, arm_arch_t2) ? 2 : 1); /* Tag_VFP_arch. */ - if (ARM_CPU_HAS_FEATURE (thumb_arch_used, fpu_vfp_ext_d32) - || ARM_CPU_HAS_FEATURE (arm_arch_used, fpu_vfp_ext_d32)) - bfd_elf_add_proc_attr_int (stdoutput, 10, 4); - else if (ARM_CPU_HAS_FEATURE (thumb_arch_used, fpu_vfp_ext_v3) - || ARM_CPU_HAS_FEATURE (arm_arch_used, fpu_vfp_ext_v3)) - bfd_elf_add_proc_attr_int (stdoutput, 10, 3); - else if (ARM_CPU_HAS_FEATURE (thumb_arch_used, fpu_vfp_ext_v2) - || ARM_CPU_HAS_FEATURE (arm_arch_used, fpu_vfp_ext_v2)) - bfd_elf_add_proc_attr_int (stdoutput, 10, 2); - else if (ARM_CPU_HAS_FEATURE (thumb_arch_used, fpu_vfp_ext_v1) - || ARM_CPU_HAS_FEATURE (arm_arch_used, fpu_vfp_ext_v1) - || ARM_CPU_HAS_FEATURE (thumb_arch_used, fpu_vfp_ext_v1xd) - || ARM_CPU_HAS_FEATURE (arm_arch_used, fpu_vfp_ext_v1xd)) - bfd_elf_add_proc_attr_int (stdoutput, 10, 1); + if (ARM_CPU_HAS_FEATURE (flags, fpu_vfp_ext_d32)) + aeabi_set_attribute_int (Tag_VFP_arch, 3); + else if (ARM_CPU_HAS_FEATURE (flags, fpu_vfp_ext_v3)) + aeabi_set_attribute_int (Tag_VFP_arch, 4); + else if (ARM_CPU_HAS_FEATURE (flags, fpu_vfp_ext_v2)) + aeabi_set_attribute_int (Tag_VFP_arch, 2); + else if (ARM_CPU_HAS_FEATURE (flags, fpu_vfp_ext_v1) + || ARM_CPU_HAS_FEATURE (flags, fpu_vfp_ext_v1xd)) + aeabi_set_attribute_int (Tag_VFP_arch, 1); /* Tag_WMMX_arch. */ - if (ARM_CPU_HAS_FEATURE (thumb_arch_used, arm_cext_iwmmxt) - || ARM_CPU_HAS_FEATURE (arm_arch_used, arm_cext_iwmmxt)) - bfd_elf_add_proc_attr_int (stdoutput, 11, 1); - /* Tag_NEON_arch. */ + if (ARM_CPU_HAS_FEATURE (flags, arm_cext_iwmmxt2)) + aeabi_set_attribute_int (Tag_WMMX_arch, 2); + else if (ARM_CPU_HAS_FEATURE (flags, arm_cext_iwmmxt)) + aeabi_set_attribute_int (Tag_WMMX_arch, 1); + /* Tag_Advanced_SIMD_arch (formerly Tag_NEON_arch). */ if (ARM_CPU_HAS_FEATURE (flags, fpu_neon_ext_v1)) - bfd_elf_add_proc_attr_int (stdoutput, 12, 1); - /* Tag_NEON_FP16_arch. */ + aeabi_set_attribute_int (Tag_Advanced_SIMD_arch, 1); + /* Tag_VFP_HP_extension (formerly Tag_NEON_FP16_arch). */ if (ARM_CPU_HAS_FEATURE (flags, fpu_neon_fp16)) - bfd_elf_add_proc_attr_int (stdoutput, 36, 1); + aeabi_set_attribute_int (Tag_VFP_HP_extension, 1); } /* Add the default contents for the .ARM.attributes section. */ |