This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
RE: [PATCH] Copy symbol flags when doing an assignment with a ternary operator.
- From: Simon Dardis <Simon dot Dardis at imgtec dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>, Nick Clifton <nickc at redhat dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Mon, 19 Oct 2015 10:15:02 +0000
- Subject: RE: [PATCH] Copy symbol flags when doing an assignment with a ternary operator.
- Authentication-results: sourceware.org; auth=none
- References: <B83211783F7A334B926F0C0CA42E32CAF433BB at hhmail02 dot hh dot imgtec dot org> <561F9C65 dot 4040207 at redhat dot com> <CAMe9rOojKe3MO0LB1sznQ-wRe6Nm4hXRnE6Fmxk0EPM3vYsX0w at mail dot gmail dot com>
Hello,
My apologies, I should have supplied a testcase. Testcase below, passes
on mips-img-elf, mips-mti-elf, mips-img-linux-gnu, sparc-linux-gnu and
x86_64-linux-gnu.
Thanks,
Simon
ld/testsuite/
* ld-elf/attributes.d: New test for symbol attribute copying.
* ld-elf/attributes.ld: Part of above.
* ld-elf/attributes.s: Likewise.
diff --git a/ld/testsuite/ld-elf/attributes.d b/ld/testsuite/ld-elf/attributes.d
new file mode 100644
index 0000000..6356bbe
--- /dev/null
+++ b/ld/testsuite/ld-elf/attributes.d
@@ -0,0 +1,8 @@
+#name: Symbol flags copy
+#ld: -T attributes.ld
+#objdump: -t
+
+#...
+0+0000000 g F .text 0+0000000 __start
+0+0000000 g F .text 0+0000000 start
+#pass
diff --git a/ld/testsuite/ld-elf/attributes.ld b/ld/testsuite/ld-elf/attributes.ld
new file mode 100644
index 0000000..f6cfe4a
--- /dev/null
+++ b/ld/testsuite/ld-elf/attributes.ld
@@ -0,0 +1,9 @@
+PROVIDE ( __start = DEFINED(start) ? start : 0xbfc00000);
+ENTRY (__start)
+SECTIONS
+{
+ .text :
+ {
+ *(.text)
+ }
+}
diff --git a/ld/testsuite/ld-elf/attributes.s b/ld/testsuite/ld-elf/attributes.s
new file mode 100644
index 0000000..bb47536
--- /dev/null
+++ b/ld/testsuite/ld-elf/attributes.s
@@ -0,0 +1,5 @@
+ .text
+ .globl start
+ .type start, %function
+start:
+ .byte 0
--
2.1.0
-----Original Message-----
From: binutils-owner@sourceware.org [mailto:binutils-owner@sourceware.org] On Behalf Of H.J. Lu
Sent: 15 October 2015 13:35
To: Nick Clifton
Cc: Simon Dardis; binutils@sourceware.org
Subject: Re: [PATCH] Copy symbol flags when doing an assignment with a ternary operator.
On Thu, Oct 15, 2015 at 5:30 AM, Nick Clifton <nickc@redhat.com> wrote:
> Hi Simon,
>
>> ld/ChangeLog
>> * ld/ldexp.c: (try_copy_symbol_flags): New. Factored out from..
>> (exp_fold_tree_1): Here. Cope with ternary
>> operator
>> in assignments. Use new helper.
>
>
> Approved and applied - thanks for the patch!
Do we have a testcase to very it even works as expected?
--
H.J.