diff options
author | Andrew Stubbs <andrew.stubbs@st.com> | 2009-01-19 12:14:05 +0000 |
---|---|---|
committer | Andrew Stubbs <andrew.stubbs@st.com> | 2009-01-19 12:14:05 +0000 |
commit | 5aa6ff7ca4d5209dece43cf89fa5750f5dcaa033 (patch) | |
tree | af1aaeae14e0dbe24962fe72cd800af96678760b /bfd/elf32-arm.c | |
parent | 3483fe2e0bd83ee8dba72f73c6a309cae2d75e7e (diff) | |
download | fsf-binutils-gdb-5aa6ff7ca4d5209dece43cf89fa5750f5dcaa033.zip fsf-binutils-gdb-5aa6ff7ca4d5209dece43cf89fa5750f5dcaa033.tar.gz fsf-binutils-gdb-5aa6ff7ca4d5209dece43cf89fa5750f5dcaa033.tar.bz2 |
2009-01-19 Andrew Stubbs <ams@codesourcery.com>
bfd/
* elf-attrs.c (vendor_set_obj_attr_contents): Support tag ordering.
* elf-bfd.h (elf_backend_data): Add obj_attrs_order.
* elf32-arm.c (elf32_arm_obj_attrs_order): New function.
(elf_backend_obj_attrs_order): New define.
* elfxx-target.h (elf_backend_obj_attrs_order): New define.
(elfNN_bed): Add elf_backend_obj_attrs_order.
gas/testsuite/
* gas/arm/attr-order.d: New file.
* gas/arm/attr-order.s: New file.
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r-- | bfd/elf32-arm.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index bf1f06f..5fdd138 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -8149,6 +8149,24 @@ elf32_arm_obj_attrs_arg_type (int tag) return (tag & 1) != 0 ? ATTR_TYPE_FLAG_STR_VAL : ATTR_TYPE_FLAG_INT_VAL; } +/* The ABI defines that Tag_conformance should be emitted first, and that + Tag_nodefaults should be second (if either is defined). This sets those + two positions, and bumps up the position of all the remaining tags to + compensate. */ +static int +elf32_arm_obj_attrs_order (int num) +{ + if (num == 4) + return Tag_conformance; + if (num == 5) + return Tag_nodefaults; + if ((num - 2) < Tag_nodefaults) + return num - 2; + if ((num - 1) < Tag_conformance) + return num - 1; + return num; +} + /* Read the architecture from the Tag_also_compatible_with attribute, if any. Returns -1 if no architecture could be read. */ @@ -12292,6 +12310,7 @@ const struct elf_size_info elf32_arm_size_info = #define elf_backend_obj_attrs_arg_type elf32_arm_obj_attrs_arg_type #undef elf_backend_obj_attrs_section_type #define elf_backend_obj_attrs_section_type SHT_ARM_ATTRIBUTES +#define elf_backend_obj_attrs_order elf32_arm_obj_attrs_order #include "elf32-target.h" |