This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] PR ld/18720: Properly merge non-default versioned symbol
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Cary Coutant <ccoutant at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Mon, 27 Jul 2015 09:39:25 -0700
- Subject: Re: [PATCH] PR ld/18720: Properly merge non-default versioned symbol
- Authentication-results: sourceware.org; auth=none
- References: <20150726221550 dot GA16472 at gmail dot com> <CAJimCsGatEeKRRYcwYG_v-s5O=wE-2mbFjNkLiHzfi0RdCLu0A at mail dot gmail dot com>
On Mon, Jul 27, 2015 at 9:11 AM, Cary Coutant <ccoutant@gmail.com> wrote:
>> diff --git a/ld/testsuite/ld-elf/pr18720.out b/ld/testsuite/ld-elf/pr18720.out
>> new file mode 100644
>> index 0000000..482e981
>> --- /dev/null
>> +++ b/ld/testsuite/ld-elf/pr18720.out
>> @@ -0,0 +1,2 @@
>> +MAIN
>> +DSO
>
> Why should the direct call to foo from the main program bind to the
> non-default versioned symbol? It seems to me that both calls should
> bind to the version in the DSO.
It is because foo is defined in main.
>> diff --git a/ld/testsuite/ld-elf/pr18720a.c b/ld/testsuite/ld-elf/pr18720a.c
>> new file mode 100644
>> index 0000000..39bbcb1
>> --- /dev/null
>> +++ b/ld/testsuite/ld-elf/pr18720a.c
>> @@ -0,0 +1,18 @@
>> +extern void bar (void);
>> +extern void foo (void);
>> +
>> +__attribute__ ((noinline, noclone))
>> +int
>> +foo_p (void)
>> +{
>> + return (long) &foo == 0x12345678 ? 1 : 0;
>> +}
>
> You don't have any checks to see which version the indirect reference
> actually binds to.
You are right. I will update the testcase.
Thanks.
--
H.J.