aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2007-07-03 15:21:30 +0000
committerJoseph Myers <joseph@codesourcery.com>2007-07-03 15:21:30 +0000
commit3cfad14c4a2b29ed8939e8e749b2a1c2f2b15f9e (patch)
treeaf6a721dc80507ad8a9cd765e9a0a1cc4b2f0ab3
parentcd123cb70c845b890eed231a84e6e84c92c2ef92 (diff)
downloadgdb-3cfad14c4a2b29ed8939e8e749b2a1c2f2b15f9e.zip
gdb-3cfad14c4a2b29ed8939e8e749b2a1c2f2b15f9e.tar.gz
gdb-3cfad14c4a2b29ed8939e8e749b2a1c2f2b15f9e.tar.bz2
bfd:
* elf32-arm.c (elf32_arm_merge_eabi_attributes): Copy type from input attributes if value has been copied. ld/testsuite: * ld-arm/attr-merge-2a.s, ld-arm/attr-merge-2b.s, ld-arm/attr-merge-2.attr: New. * ld-arm/arm-elf.exp (armelftests): Add new test.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf32-arm.c17
-rw-r--r--ld/testsuite/ChangeLog6
-rw-r--r--ld/testsuite/ld-arm/arm-elf.exp3
-rw-r--r--ld/testsuite/ld-arm/attr-merge-2.attr12
-rw-r--r--ld/testsuite/ld-arm/attr-merge-2a.s10
-rw-r--r--ld/testsuite/ld-arm/attr-merge-2b.s11
7 files changed, 64 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 50226f2..8565680 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2007-07-03 Joseph Myers <joseph@codesourcery.com>
+
+ * elf32-arm.c (elf32_arm_merge_eabi_attributes): Copy type from
+ input attributes if value has been copied.
+
2007-07-03 Nick Clifton <nickc@redhat.com>
* COPYING: Replace with GPLv3 text.
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index e335888..ab47558 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -6934,6 +6934,23 @@ elf32_arm_merge_eabi_attributes (bfd *ibfd, bfd *obfd)
default: /* All known attributes should be explicitly covered. */
abort ();
}
+
+ if (in_attr[i].type && !out_attr[i].type)
+ switch (in_attr[i].type)
+ {
+ case 1:
+ if (out_attr[i].i)
+ out_attr[i].type = 1;
+ break;
+
+ case 2:
+ if (out_attr[i].s)
+ out_attr[i].type = 2;
+ break;
+
+ default:
+ abort ();
+ }
}
/* Merge Tag_compatibility attributes and any common GNU ones. */
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 7cb33ce..e6304b9 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2007-07-03 Joseph Myers <joseph@codesourcery.com>
+
+ * ld-arm/attr-merge-2a.s, ld-arm/attr-merge-2b.s,
+ ld-arm/attr-merge-2.attr: New.
+ * ld-arm/arm-elf.exp (armelftests): Add new test.
+
2007-07-02 Nathan Sidwell <nathan@codesourcery.com>
* ld-scripts/alignof.exp: Skip on non-elf
diff --git a/ld/testsuite/ld-arm/arm-elf.exp b/ld/testsuite/ld-arm/arm-elf.exp
index a83c1ee..21adf57 100644
--- a/ld/testsuite/ld-arm/arm-elf.exp
+++ b/ld/testsuite/ld-arm/arm-elf.exp
@@ -170,6 +170,9 @@ set armelftests {
{"EABI attribute merging" "-r" "" {attr-merge.s attr-merge.s}
{{readelf -A attr-merge.attr}}
"attr-merge"}
+ {"EABI attribute merging 2" "-r" "" {attr-merge-2a.s attr-merge-2b.s}
+ {{readelf -A attr-merge-2.attr}}
+ "attr-merge-2"}
{"callweak" "-static -T arm.ld" "" {callweak.s}
{{objdump -dr callweak.d}}
"callweak"}
diff --git a/ld/testsuite/ld-arm/attr-merge-2.attr b/ld/testsuite/ld-arm/attr-merge-2.attr
new file mode 100644
index 0000000..341e6d1
--- /dev/null
+++ b/ld/testsuite/ld-arm/attr-merge-2.attr
@@ -0,0 +1,12 @@
+Attribute Section: aeabi
+File Attributes
+ Tag_CPU_name: "ARM7TDMI"
+ Tag_CPU_arch: v4T
+ Tag_ABI_PCS_wchar_t: 4
+ Tag_ABI_FP_denormal: Needed
+ Tag_ABI_FP_exceptions: Needed
+ Tag_ABI_FP_number_model: IEEE 754
+ Tag_ABI_align8_needed: Yes
+ Tag_ABI_align8_preserved: Yes, except leaf SP
+ Tag_ABI_enum_size: small
+ Tag_ABI_optimization_goals: Aggressive Debug
diff --git a/ld/testsuite/ld-arm/attr-merge-2a.s b/ld/testsuite/ld-arm/attr-merge-2a.s
new file mode 100644
index 0000000..0303163
--- /dev/null
+++ b/ld/testsuite/ld-arm/attr-merge-2a.s
@@ -0,0 +1,10 @@
+ .cpu arm7tdmi
+ .fpu softvfp
+ .eabi_attribute 20, 1
+ .eabi_attribute 21, 1
+ .eabi_attribute 23, 3
+ .eabi_attribute 24, 1
+ .eabi_attribute 25, 1
+ .eabi_attribute 26, 1
+ .eabi_attribute 30, 6
+ .file "attr-merge-2a.s"
diff --git a/ld/testsuite/ld-arm/attr-merge-2b.s b/ld/testsuite/ld-arm/attr-merge-2b.s
new file mode 100644
index 0000000..047890a
--- /dev/null
+++ b/ld/testsuite/ld-arm/attr-merge-2b.s
@@ -0,0 +1,11 @@
+ .cpu arm7tdmi
+ .fpu softvfp
+ .eabi_attribute 20, 1
+ .eabi_attribute 21, 1
+ .eabi_attribute 23, 3
+ .eabi_attribute 24, 1
+ .eabi_attribute 25, 1
+ .eabi_attribute 26, 1
+ .eabi_attribute 30, 6
+ .eabi_attribute 18, 4
+ .file "attr-merge-2b.s"