diff mbox

[2/3] Add hidden_proto for getauxval

Message ID 20170608225728.26779-3-rth@twiddle.net
State New
Headers show

Commit Message

Richard Henderson June 8, 2017, 10:57 p.m. UTC
---
 include/sys/auxv.h | 2 ++
 misc/getauxval.c   | 1 +
 2 files changed, 3 insertions(+)

Comments

Siddhesh Poyarekar June 9, 2017, 5:53 a.m. UTC | #1
On Friday 09 June 2017 04:27 AM, Richard Henderson wrote:
> ---
>  include/sys/auxv.h | 2 ++
>  misc/getauxval.c   | 1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/include/sys/auxv.h b/include/sys/auxv.h
> index dede2c3..2e1f86b 100644
> --- a/include/sys/auxv.h
> +++ b/include/sys/auxv.h
> @@ -1 +1,3 @@
>  #include <misc/sys/auxv.h>
> +
> +libc_hidden_proto (getauxval)
> diff --git a/misc/getauxval.c b/misc/getauxval.c
> index c83fbce..458f58d 100644
> --- a/misc/getauxval.c
> +++ b/misc/getauxval.c
> @@ -43,3 +43,4 @@ __getauxval (unsigned long int type)
>  }
>  
>  weak_alias (__getauxval, getauxval)
> +libc_hidden_weak (getauxval)

This is fine, but you could just merge this into 3/3 (where this gets
used first), which I won't review since I haven't looked at a powerpc
box in anger for years :)

Siddhesh
Florian Weimer June 9, 2017, 6:58 a.m. UTC | #2
On 06/09/2017 12:57 AM, Richard Henderson wrote:
> +libc_hidden_weak (getauxval)

This should be libc_hidden_proto (__getauxval).  I don't think you can
call getauxval from libc.so because it leads to a namespace violation.

Thanks,
Florian
Richard Henderson June 9, 2017, 5:45 p.m. UTC | #3
On 06/08/2017 11:58 PM, Florian Weimer wrote:
> On 06/09/2017 12:57 AM, Richard Henderson wrote:
>> +libc_hidden_weak (getauxval)
> 
> This should be libc_hidden_proto (__getauxval).  I don't think you can
> call getauxval from libc.so because it leads to a namespace violation.

 From libc.so you certainly can, because we'll actually call __GI_getauxval.


r~
Florian Weimer June 9, 2017, 5:49 p.m. UTC | #4
On 06/09/2017 07:45 PM, Richard Henderson wrote:
> On 06/08/2017 11:58 PM, Florian Weimer wrote:
>> On 06/09/2017 12:57 AM, Richard Henderson wrote:
>>> +libc_hidden_weak (getauxval)
>>
>> This should be libc_hidden_proto (__getauxval).  I don't think you can
>> call getauxval from libc.so because it leads to a namespace violation.
> 
> From libc.so you certainly can, because we'll actually call __GI_getauxval.

Yes, but not from libc.a, which is better to have the hidden alias for
the __ variant.

Florian
Richard Henderson June 9, 2017, 10:11 p.m. UTC | #5
On 06/09/2017 10:49 AM, Florian Weimer wrote:
> On 06/09/2017 07:45 PM, Richard Henderson wrote:
>> On 06/08/2017 11:58 PM, Florian Weimer wrote:
>>> On 06/09/2017 12:57 AM, Richard Henderson wrote:
>>>> +libc_hidden_weak (getauxval)
>>>
>>> This should be libc_hidden_proto (__getauxval).  I don't think you can
>>> call getauxval from libc.so because it leads to a namespace violation.
>>
>>  From libc.so you certainly can, because we'll actually call __GI_getauxval.
> 
> Yes, but not from libc.a, which is better to have the hidden alias for
> the __ variant.

Quite right.


r~
diff mbox

Patch

diff --git a/include/sys/auxv.h b/include/sys/auxv.h
index dede2c3..2e1f86b 100644
--- a/include/sys/auxv.h
+++ b/include/sys/auxv.h
@@ -1 +1,3 @@ 
 #include <misc/sys/auxv.h>
+
+libc_hidden_proto (getauxval)
diff --git a/misc/getauxval.c b/misc/getauxval.c
index c83fbce..458f58d 100644
--- a/misc/getauxval.c
+++ b/misc/getauxval.c
@@ -43,3 +43,4 @@  __getauxval (unsigned long int type)
 }
 
 weak_alias (__getauxval, getauxval)
+libc_hidden_weak (getauxval)