From: "Joseph S. Myers" <joseph@codesourcery.com>
To: binutils@sourceware.org
Subject: Fix another ARM attribute merging bug
Date: Fri, 29 Jun 2007 00:42:00 -0000 [thread overview]
Message-ID: <Pine.LNX.4.64.0706290039380.12849@digraph.polyomino.org.uk> (raw)
This patch fixes a bug in the ARM-specific object attribute merging; it is
independent of my generic attributes patch.
When an attribute is merged from a second or subsequent input file to the
output, the type field must be set so that the merged attribute gets
copied to the output. (For example, a first file that doesn't use wchar_t
and a second that specifies a wchar_t size - not a case GCC will generate
since it doesn't know how to check whether wchar_t is used in a public
interface.)
Tested with cross to arm-none-eabi. OK to commit?
bfd:
2007-06-29 Joseph Myers <joseph@codesourcery.com>
* elf32-arm.c (elf32_arm_merge_eabi_attributes): Copy type from
input attributes if value has been copied.
ld/testsuite:
2007-06-29 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.
Index: bfd/elf32-arm.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arm.c,v
retrieving revision 1.119
diff -u -r1.119 elf32-arm.c
--- bfd/elf32-arm.c 26 Jun 2007 13:55:04 -0000 1.119
+++ bfd/elf32-arm.c 29 Jun 2007 00:35:08 -0000
@@ -7279,6 +7279,23 @@
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 ();
+ }
}
in_list = elf32_arm_tdata (ibfd)->other_eabi_attributes;
Index: ld/testsuite/ld-arm/arm-elf.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-arm/arm-elf.exp,v
retrieving revision 1.27
diff -u -r1.27 arm-elf.exp
--- ld/testsuite/ld-arm/arm-elf.exp 26 Jun 2007 13:55:04 -0000 1.27
+++ ld/testsuite/ld-arm/arm-elf.exp 29 Jun 2007 00:35:09 -0000
@@ -170,6 +170,9 @@
{"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"}
}
run_ld_link_tests $armelftests
Index: ld/testsuite/ld-arm/attr-merge-2.attr
===================================================================
RCS file: ld/testsuite/ld-arm/attr-merge-2.attr
diff -N ld/testsuite/ld-arm/attr-merge-2.attr
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ld/testsuite/ld-arm/attr-merge-2.attr 29 Jun 2007 00:35:09 -0000
@@ -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
Index: ld/testsuite/ld-arm/attr-merge-2a.s
===================================================================
RCS file: ld/testsuite/ld-arm/attr-merge-2a.s
diff -N ld/testsuite/ld-arm/attr-merge-2a.s
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ld/testsuite/ld-arm/attr-merge-2a.s 29 Jun 2007 00:35:09 -0000
@@ -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-1a.s"
Index: ld/testsuite/ld-arm/attr-merge-2b.s
===================================================================
RCS file: ld/testsuite/ld-arm/attr-merge-2b.s
diff -N ld/testsuite/ld-arm/attr-merge-2b.s
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ld/testsuite/ld-arm/attr-merge-2b.s 29 Jun 2007 00:35:09 -0000
@@ -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-1b.s"
--
Joseph S. Myers
joseph@codesourcery.com
next reply other threads:[~2007-06-29 0:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-29 0:42 Joseph S. Myers [this message]
2007-07-03 15:51 ` Nick Clifton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0706290039380.12849@digraph.polyomino.org.uk \
--to=joseph@codesourcery.com \
--cc=binutils@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).