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: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Simon Dardis <Simon dot Dardis at imgtec dot com>
- Cc: Nick Clifton <nickc at redhat dot com>, "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Mon, 19 Oct 2015 03:48:41 -0700
- 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> <B83211783F7A334B926F0C0CA42E32CA010147B5 at hhmail02 dot hh dot imgtec dot org>
On Mon, Oct 19, 2015 at 3:15 AM, Simon Dardis <Simon.Dardis@imgtec.com> wrote:
> 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
>
You need to tests both true and false.
--
H.J.