Message ID | 20210722132200.43895-1-isaev@synopsys.com |
---|---|
State | New |
Headers | show |
Series | elf: _dl_fixup*: make @reloc_arg 64-bit safe | expand |
On Jul 22 2021, Vladimir Isaev via Libc-alpha wrote: > diff --git a/elf/dl-runtime.c b/elf/dl-runtime.c > index 9d0d941000..6099a44ffb 100644 > --- a/elf/dl-runtime.c > +++ b/elf/dl-runtime.c > @@ -56,7 +56,7 @@ _dl_fixup ( > # ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS > ELF_MACHINE_RUNTIME_FIXUP_ARGS, > # endif > - struct link_map *l, ElfW(Word) reloc_arg) > + struct link_map *l, uintptr_t reloc_arg) ElfW(Addr)? Andreas.
On Jul 22 2021, Andreas Schwab wrote: > > On Jul 22 2021, Vladimir Isaev via Libc-alpha wrote: > > > diff --git a/elf/dl-runtime.c b/elf/dl-runtime.c > > index 9d0d941000..6099a44ffb 100644 > > --- a/elf/dl-runtime.c > > +++ b/elf/dl-runtime.c > > @@ -56,7 +56,7 @@ _dl_fixup ( > > # ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS > > ELF_MACHINE_RUNTIME_FIXUP_ARGS, > > # endif > > - struct link_map *l, ElfW(Word) reloc_arg) > > + struct link_map *l, uintptr_t reloc_arg) > > ElfW(Addr)? > We can use it, but I think that uintptr_t is more natural here because it is used in reloc_offset and reloc_index. Thank you, Vladimir Isaev
Hi Joseph, Adhemerval, Florian On 7/22/21 6:58 AM, Vladimir Isaev via Libc-alpha wrote: > On Jul 22 2021, Andreas Schwab wrote: >> >> On Jul 22 2021, Vladimir Isaev via Libc-alpha wrote: >> >>> diff --git a/elf/dl-runtime.c b/elf/dl-runtime.c >>> index 9d0d941000..6099a44ffb 100644 >>> --- a/elf/dl-runtime.c >>> +++ b/elf/dl-runtime.c >>> @@ -56,7 +56,7 @@ _dl_fixup ( >>> # ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS >>> ELF_MACHINE_RUNTIME_FIXUP_ARGS, >>> # endif >>> - struct link_map *l, ElfW(Word) reloc_arg) >>> + struct link_map *l, uintptr_t reloc_arg) >> >> ElfW(Addr)? >> > > We can use it, but I think that uintptr_t is more natural here because it is used > in reloc_offset and reloc_index. Any objections to this change - OK to commit ? -Vineet
diff --git a/elf/dl-runtime.c b/elf/dl-runtime.c index 9d0d941000..6099a44ffb 100644 --- a/elf/dl-runtime.c +++ b/elf/dl-runtime.c @@ -56,7 +56,7 @@ _dl_fixup ( # ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS ELF_MACHINE_RUNTIME_FIXUP_ARGS, # endif - struct link_map *l, ElfW(Word) reloc_arg) + struct link_map *l, uintptr_t reloc_arg) { const ElfW(Sym) *const symtab = (const void *) D_PTR (l, l_info[DT_SYMTAB]); @@ -152,7 +152,7 @@ _dl_profile_fixup ( #ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS ELF_MACHINE_RUNTIME_FIXUP_ARGS, #endif - struct link_map *l, ElfW(Word) reloc_arg, + struct link_map *l, uintptr_t reloc_arg, ElfW(Addr) retaddr, void *regs, long int *framesizep) { void (*mcount_fct) (ElfW(Addr), ElfW(Addr)) = _dl_mcount; @@ -484,7 +484,7 @@ _dl_profile_fixup ( #include <stdio.h> void ARCH_FIXUP_ATTRIBUTE -_dl_call_pltexit (struct link_map *l, ElfW(Word) reloc_arg, +_dl_call_pltexit (struct link_map *l, uintptr_t reloc_arg, const void *inregs, void *outregs) { #ifdef SHARED diff --git a/sysdeps/hppa/dl-fptr.c b/sysdeps/hppa/dl-fptr.c index 62ef68b62b..bcab1bf100 100644 --- a/sysdeps/hppa/dl-fptr.c +++ b/sysdeps/hppa/dl-fptr.c @@ -321,7 +321,7 @@ _dl_unmap (struct link_map *map) map->l_mach.fptr_table = NULL; } -extern ElfW(Addr) _dl_fixup (struct link_map *, ElfW(Word)) attribute_hidden; +extern ElfW(Addr) _dl_fixup (struct link_map *, uintptr_t) attribute_hidden; static inline Elf32_Addr elf_machine_resolve (void) diff --git a/sysdeps/i386/dl-machine.h b/sysdeps/i386/dl-machine.h index 590b41d8d7..8f73e0efda 100644 --- a/sysdeps/i386/dl-machine.h +++ b/sysdeps/i386/dl-machine.h @@ -130,10 +130,10 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) #define ARCH_FIXUP_ATTRIBUTE __attribute__ ((regparm (3), stdcall, unused)) extern ElfW(Addr) _dl_fixup (struct link_map *l, - ElfW(Word) reloc_offset) + uintptr_t reloc_offset) ARCH_FIXUP_ATTRIBUTE; extern ElfW(Addr) _dl_profile_fixup (struct link_map *l, - ElfW(Word) reloc_offset, + uintptr_t reloc_offset, ElfW(Addr) retaddr, void *regs, long int *framesizep) ARCH_FIXUP_ATTRIBUTE;