things to do for arch maintainers

Steven Munroe munroesj@us.ibm.com
Tue Dec 20 23:34:00 GMT 2005


Jakub Jelinek wrote:

>On Tue, Dec 20, 2005 at 04:05:40PM -0600, Steven Munroe wrote:
>  
>
>>Jakub got to the powerpc change before I could finish testing my 
>>version. No problem with Jukub's quickness, but I notice that his 
>>version does not fill in the
>>
>>"#if defined NOT_IN_libc && defined IS_IN_rtld"
>>
>>
>>case. While the X86_64 example does.
>>    
>>
>
>Uli did that part already earlier for
>sysdeps/powerpc/powerpc32/setjmp-common.S:
>
>#if defined NOT_IN_libc && defined IS_IN_rtld
>        li   r3,0
>        blr
>#else
>        b BP_SYM (__sigjmp_save@local)
>#endif
>
>  
>
I was refering to defining the PTR_MANGLE/PTR_DEMANGLE macros for the 
IS_IN_RTLD case. X86_64 defines:

#if defined NOT_IN_libc && defined IS_IN_rtld
/* We cannot use the thread descriptor because in ld.so we use setjmp
   earlier than the descriptor is initialized.  */
# ifdef __ASSEMBLER__
#  define PTR_MANGLE(reg)    xorq __pointer_chk_guard_local(%rip), reg
#  define PTR_DEMANGLE(reg)    PTR_MANGLE (reg)
# else
#  define PTR_MANGLE(reg)    asm ("xorq 
__pointer_chk_guard_local(%%rip), %0"\
                     : "=r" (reg) : "0" (reg))
#  define PTR_DEMANGLE(reg)    PTR_MANGLE (reg)
# endif
...

While powerpc and most other arch's leave the macros undefined for the 
IS_IN_RTLD case.

This may be appropriate because powerpc does not have a pc relative 
reference to access __pointer_chk_guard_local and access via the 
.got/.toc will fail if access is attemped before the got/toc are 
relocated. But I wanted to verify this.

It is not clear what this change is really for, so it is difficult to 
determine what is intended or required.



More information about the Libc-hacker mailing list