Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
git-mirror
/
glibc
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
0
Security
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security
Insights
Files
e49dc84
abilist
aout
argp
assert
bits
catgets
conf
conform
crypt
csu
ctype
debug
dirent
dlfcn
elf
.cvsignore
Makefile
Versions
cache.c
check-localplt.c
check-textrel.c
chroot_canon.c
circleload1.c
circlemod1.c
circlemod1a.c
circlemod2.c
circlemod2a.c
circlemod3.c
circlemod3a.c
constload1.c
constload2.c
constload3.c
dblload.c
dblloadmod1.c
dblloadmod2.c
dblloadmod3.c
dblunload.c
dep1.c
dep2.c
dep3.c
dep4.c
dl-addr.c
dl-brk.c
dl-cache.c
dl-caller.c
dl-close.c
dl-conflict.c
dl-debug.c
dl-deps.c
dl-dst.h
dl-environ.c
dl-error.c
dl-execstack.c
dl-fini.c
dl-fptr.c
dl-init.c
dl-iteratephdr.c
dl-libc.c
dl-load.c
dl-lookup.c
dl-minimal.c
dl-misc.c
dl-object.c
dl-open.c
dl-origin.c
dl-profile.c
dl-profstub.c
dl-reloc.c
dl-runtime.c
dl-sbrk.c
dl-support.c
dl-sym.c
dl-symaddr.c
dl-sysdep.c
dl-tls.c
dl-trampoline.c
dl-tsd.c
dl-version.c
do-lookup.h
do-rel.h
dynamic-link.h
elf.h
enbl-secure.c
failobj.c
filter.c
filtmod1.c
filtmod2.c
firstobj.c
gen-trusted-dirs.awk
genrtldtbl.awk
global.c
globalmod1.c
initfirst.c
interp.c
lateglobal.c
ldconfig.c
ldd.bash.in
link.h
loadfail.c
loadtest.c
ltglobmod1.c
ltglobmod2.c
multiload.c
neededobj1.c
neededobj2.c
neededobj3.c
neededobj4.c
neededobj5.c
neededobj6.c
neededtest.c
neededtest2.c
neededtest3.c
neededtest4.c
next.c
nextmod1.c
nextmod2.c
nodel2mod1.c
nodel2mod2.c
nodel2mod3.c
nodelete.c
nodelete2.c
nodelmod1.c
nodelmod2.c
nodelmod3.c
nodelmod4.c
nodlopen.c
nodlopen2.c
nodlopenmod.c
nodlopenmod2.c
noload.c
order.c
order2.c
order2mod1.c
order2mod2.c
order2mod3.c
order2mod4.c
origtest.c
pathoptobj.c
preloadtest.c
readelflib.c
readlib.c
reldep.c
reldep2.c
reldep3.c
reldep4.c
reldep4mod1.c
reldep4mod2.c
reldep4mod3.c
reldep4mod4.c
reldep5.c
reldep6.c
reldep6mod0.c
reldep6mod1.c
reldep6mod2.c
reldep6mod3.c
reldep6mod4.c
reldep7.c
reldep7mod1.c
reldep7mod2.c
reldep8.c
reldep8mod1.c
reldep8mod2.c
reldep8mod3.c
reldep9.c
reldep9mod1.c
reldep9mod2.c
reldep9mod3.c
reldepmod1.c
reldepmod2.c
reldepmod3.c
reldepmod4.c
reldepmod5.c
reldepmod6.c
resolvfail.c
restest1.c
restest2.c
rtld-Rules
rtld.c
sln.c
sofini.c
soinit.c
sprof.c
stackguard-macros.h
testobj.h
testobj1.c
testobj1_1.c
testobj2.c
testobj3.c
testobj4.c
testobj5.c
testobj6.c
tls-macros.h
tlsdeschtab.h
tst-addr1.c
tst-align.c
tst-align2.c
tst-alignmod.c
tst-alignmod2.c
tst-array1-static.c
tst-array1.c
tst-array1.exp
tst-array2.c
tst-array2.exp
tst-array2dep.c
tst-array3.c
tst-array4.c
tst-array4.exp
tst-array5-static.c
tst-array5-static.exp
tst-array5.c
tst-array5.exp
tst-array5dep.c
tst-audit1.c
tst-audit2.c
tst-auditmod1.c
tst-deep1.c
tst-deep1mod1.c
tst-deep1mod2.c
tst-deep1mod3.c
tst-dlmodcount.c
tst-dlmopen1.c
tst-dlmopen1mod.c
tst-dlmopen2.c
tst-dlmopen3.c
tst-dlopenrpath.c
tst-dlopenrpathmod.c
tst-execstack-mod.c
tst-execstack-needed.c
tst-execstack-prog.c
tst-execstack.c
tst-global1.c
tst-leaks1.c
tst-pathopt.c
tst-pathopt.sh
tst-pie1.c
tst-piemod1.c
tst-stackguard1-static.c
tst-stackguard1.c
tst-thrlock.c
tst-tls-dlinfo.c
tst-tls1-static.c
tst-tls1.c
tst-tls10.c
tst-tls10.h
tst-tls11.c
tst-tls12.c
tst-tls13.c
tst-tls14.c
tst-tls15.c
tst-tls16.c
tst-tls17.c
tst-tls18.c
tst-tls2-static.c
tst-tls2.c
tst-tls3.c
tst-tls4.c
tst-tls5.c
tst-tls6.c
tst-tls7.c
tst-tls8.c
tst-tls9-static.c
tst-tls9.c
tst-tlsmod1.c
tst-tlsmod10.c
tst-tlsmod11.c
tst-tlsmod12.c
tst-tlsmod13.c
tst-tlsmod13a.c
tst-tlsmod14a.c
tst-tlsmod14b.c
tst-tlsmod15a.c
tst-tlsmod15b.c
tst-tlsmod16a.c
tst-tlsmod16b.c
tst-tlsmod17a.c
tst-tlsmod17b.c
tst-tlsmod18a.c
tst-tlsmod2.c
tst-tlsmod3.c
tst-tlsmod4.c
tst-tlsmod5.c
tst-tlsmod6.c
tst-tlsmod7.c
tst-tlsmod8.c
tst-tlsmod9.c
unload.c
unload2.c
unload2dep.c
unload2mod.c
unload3.c
unload3mod1.c
unload3mod2.c
unload3mod3.c
unload3mod4.c
unload4.c
unload4mod1.c
unload4mod2.c
unload4mod3.c
unload4mod4.c
unload5.c
unload6.c
unload6mod1.c
unload6mod2.c
unload6mod3.c
unload7.c
unload7mod1.c
unload7mod2.c
unloadmod.c
vismain.c
vismod.h
vismod1.c
vismod2.c
vismod3.c
gmon
gnulib
grp
gshadow
hesiod
hurd
iconv
iconvdata
include
inet
intl
io
libidn
libio
locale
localedata
login
mach
malloc
manual
math
misc
nis
nptl
nptl_db
nscd
nss
po
posix
pwd
resolv
resource
rt
scripts
setjmp
shadow
signal
socket
soft-fp
stdio-common
stdlib
streams
string
sunrpc
sysdeps
sysvipc
termios
time
timezone
wcsmbs
wctype
.cvsignore
BUGS
CANCEL-FCT-WAIVE
CANCEL-FILE-WAIVE
CONFORMANCE
COPYING
COPYING.LIB
ChangeLog
ChangeLog.1
ChangeLog.10
ChangeLog.11
ChangeLog.12
ChangeLog.13
ChangeLog.14
ChangeLog.15
ChangeLog.16
ChangeLog.2
ChangeLog.3
ChangeLog.4
ChangeLog.5
ChangeLog.6
ChangeLog.7
ChangeLog.8
ChangeLog.9
FAQ
FAQ.in
INSTALL
LICENSES
Makeconfig
Makefile
Makefile.in
Makerules
NAMESPACE
NEWS
NOTES
PROJECTS
README
README.libm
Rules
Versions.def
WUR-REPORT
abi-tags
aclocal.m4
config-name.in
config.h.in
config.make.in
configure
configure.in
cppflags-iterator.mk
extra-lib.mk
extra-modules.mk
o-iterator.mk
shlib-versions
test-skeleton.c
tls.make.c
version.h
Breadcrumbs
glibc
/
elf
/
dl-runtime.c
Blame
Blame
Latest commit
History
History
461 lines (392 loc) · 14.9 KB
Breadcrumbs
glibc
/
elf
/
dl-runtime.c
Top
File metadata and controls
Code
Blame
461 lines (392 loc) · 14.9 KB
Raw
/* On-demand PLT fixup for shared objects. Copyright (C) 1995-2006, 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #define IN_DL_RUNTIME 1 /* This can be tested in dl-machine.h. */ #include <alloca.h> #include <stdlib.h> #include <unistd.h> #include <sys/param.h> #include <ldsodefs.h> #include <sysdep-cancel.h> #include "dynamic-link.h" #include <tls.h> #if (!defined ELF_MACHINE_NO_RELA && !defined ELF_MACHINE_PLT_REL) \ || ELF_MACHINE_NO_REL # define PLTREL ElfW(Rela) #else # define PLTREL ElfW(Rel) #endif #ifndef VERSYMIDX # define VERSYMIDX(sym) (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (sym)) #endif /* The fixup functions might have need special attributes. If none are provided define the macro as empty. */ #ifndef ARCH_FIXUP_ATTRIBUTE # define ARCH_FIXUP_ATTRIBUTE #endif #ifndef reloc_offset # define reloc_offset reloc_arg # define reloc_index reloc_arg / sizeof (PLTREL) #endif /* This function is called through a special trampoline from the PLT the first time each PLT entry is called. We must perform the relocation specified in the PLT of the given shared object, and return the resolved function address to the trampoline, which will restart the original call to that address. Future calls will bounce directly from the PLT to the function. */ #ifndef ELF_MACHINE_NO_PLT DL_FIXUP_VALUE_TYPE __attribute ((noinline)) ARCH_FIXUP_ATTRIBUTE _dl_fixup ( # ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS ELF_MACHINE_RUNTIME_FIXUP_ARGS, # endif /* GKM FIXME: Fix trampoline to pass bounds so we can do without the `__unbounded' qualifier. */ struct link_map *__unbounded l, ElfW(Word) reloc_arg) { const ElfW(Sym) *const symtab = (const void *) D_PTR (l, l_info[DT_SYMTAB]); const char *strtab = (const void *) D_PTR (l, l_info[DT_STRTAB]); const PLTREL *const reloc = (const void *) (D_PTR (l, l_info[DT_JMPREL]) + reloc_offset); const ElfW(Sym) *sym = &symtab[ELFW(R_SYM) (reloc->r_info)]; void *const rel_addr = (void *)(l->l_addr + reloc->r_offset); lookup_t result; DL_FIXUP_VALUE_TYPE value; /* Sanity check that we're really looking at a PLT relocation. */ assert (ELFW(R_TYPE)(reloc->r_info) == ELF_MACHINE_JMP_SLOT); /* Look up the target symbol. If the normal lookup rules are not used don't look in the global scope. */ if (__builtin_expect (ELFW(ST_VISIBILITY) (sym->st_other), 0) == 0) { const struct r_found_version *version = NULL; if (l->l_info[VERSYMIDX (DT_VERSYM)] != NULL) { const ElfW(Half) *vernum = (const void *) D_PTR (l, l_info[VERSYMIDX (DT_VERSYM)]); ElfW(Half) ndx = vernum[ELFW(R_SYM) (reloc->r_info)] & 0x7fff; version = &l->l_versions[ndx]; if (version->hash == 0) version = NULL; } /* We need to keep the scope around so do some locking. This is not necessary for objects which cannot be unloaded or when we are not using any threads (yet). */ int flags = DL_LOOKUP_ADD_DEPENDENCY; if (!RTLD_SINGLE_THREAD_P) { THREAD_GSCOPE_SET_FLAG (); flags |= DL_LOOKUP_GSCOPE_LOCK; } result = _dl_lookup_symbol_x (strtab + sym->st_name, l, &sym, l->l_scope, version, ELF_RTYPE_CLASS_PLT, flags, NULL); /* We are done with the global scope. */ if (!RTLD_SINGLE_THREAD_P) THREAD_GSCOPE_RESET_FLAG (); /* Currently result contains the base load address (or link map) of the object that defines sym. Now add in the symbol offset. */ value = DL_FIXUP_MAKE_VALUE (result, sym ? (LOOKUP_VALUE_ADDRESS (result) + sym->st_value) : 0); } else { /* We already found the symbol. The module (and therefore its load address) is also known. */ value = DL_FIXUP_MAKE_VALUE (l, l->l_addr + sym->st_value); result = l; } /* And now perhaps the relocation addend. */ value = elf_machine_plt_value (l, reloc, value); if (__builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0)) value = ((DL_FIXUP_VALUE_TYPE (*) (void)) DL_FIXUP_VALUE_ADDR (value)) (); /* Finally, fix up the plt itself. */ if (__builtin_expect (GLRO(dl_bind_not), 0)) return value; return elf_machine_fixup_plt (l, result, reloc, rel_addr, value); } #endif #if !defined PROF && !defined ELF_MACHINE_NO_PLT && !__BOUNDED_POINTERS__ DL_FIXUP_VALUE_TYPE __attribute ((noinline)) ARCH_FIXUP_ATTRIBUTE _dl_profile_fixup ( #ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS ELF_MACHINE_RUNTIME_FIXUP_ARGS, #endif struct link_map *l, ElfW(Word) reloc_arg, ElfW(Addr) retaddr, void *regs, long int *framesizep) { void (*mcount_fct) (ElfW(Addr), ElfW(Addr)) = INTUSE(_dl_mcount); /* This is the address in the array where we store the result of previous relocations. */ struct reloc_result *reloc_result = &l->l_reloc_result[reloc_index]; DL_FIXUP_VALUE_TYPE *resultp = &reloc_result->addr; DL_FIXUP_VALUE_TYPE value = *resultp; if (DL_FIXUP_VALUE_CODE_ADDR (value) == 0) { /* This is the first time we have to relocate this object. */ const ElfW(Sym) *const symtab = (const void *) D_PTR (l, l_info[DT_SYMTAB]); const char *strtab = (const char *) D_PTR (l, l_info[DT_STRTAB]); const PLTREL *const reloc = (const void *) (D_PTR (l, l_info[DT_JMPREL]) + reloc_offset); const ElfW(Sym) *refsym = &symtab[ELFW(R_SYM) (reloc->r_info)]; const ElfW(Sym) *defsym = refsym; lookup_t result; /* Sanity check that we're really looking at a PLT relocation. */ assert (ELFW(R_TYPE)(reloc->r_info) == ELF_MACHINE_JMP_SLOT); /* Look up the target symbol. If the symbol is marked STV_PROTECTED don't look in the global scope. */ if (__builtin_expect (ELFW(ST_VISIBILITY) (refsym->st_other), 0) == 0) { const struct r_found_version *version = NULL; if (l->l_info[VERSYMIDX (DT_VERSYM)] != NULL) { const ElfW(Half) *vernum = (const void *) D_PTR (l, l_info[VERSYMIDX (DT_VERSYM)]); ElfW(Half) ndx = vernum[ELFW(R_SYM) (reloc->r_info)] & 0x7fff; version = &l->l_versions[ndx]; if (version->hash == 0) version = NULL; } /* We need to keep the scope around so do some locking. This is not necessary for objects which cannot be unloaded or when we are not using any threads (yet). */ int flags = DL_LOOKUP_ADD_DEPENDENCY; if (!RTLD_SINGLE_THREAD_P) { THREAD_GSCOPE_SET_FLAG (); flags |= DL_LOOKUP_GSCOPE_LOCK; } result = _dl_lookup_symbol_x (strtab + refsym->st_name, l, &defsym, l->l_scope, version, ELF_RTYPE_CLASS_PLT, flags, NULL); /* We are done with the global scope. */ if (!RTLD_SINGLE_THREAD_P) THREAD_GSCOPE_RESET_FLAG (); /* Currently result contains the base load address (or link map) of the object that defines sym. Now add in the symbol offset. */ value = DL_FIXUP_MAKE_VALUE (result, defsym != NULL ? LOOKUP_VALUE_ADDRESS (result) + defsym->st_value : 0); if (__builtin_expect (ELFW(ST_TYPE) (defsym->st_info) == STT_GNU_IFUNC, 0)) value = ((DL_FIXUP_VALUE_TYPE (*) (void)) DL_FIXUP_VALUE_ADDR (value)) (); } else { /* We already found the symbol. The module (and therefore its load address) is also known. */ value = DL_FIXUP_MAKE_VALUE (l, l->l_addr + refsym->st_value); if (__builtin_expect (ELFW(ST_TYPE) (refsym->st_info) == STT_GNU_IFUNC, 0)) value = ((DL_FIXUP_VALUE_TYPE (*) (void)) DL_FIXUP_VALUE_ADDR (value)) (); result = l; } /* And now perhaps the relocation addend. */ value = elf_machine_plt_value (l, reloc, value); #ifdef SHARED /* Auditing checkpoint: we have a new binding. Provide the auditing libraries the possibility to change the value and tell us whether further auditing is wanted. */ if (defsym != NULL && GLRO(dl_naudit) > 0) { reloc_result->bound = result; /* Compute index of the symbol entry in the symbol table of the DSO with the definition. */ reloc_result->boundndx = (defsym - (ElfW(Sym) *) D_PTR (result, l_info[DT_SYMTAB])); /* Determine whether any of the two participating DSOs is interested in auditing. */ if ((l->l_audit_any_plt | result->l_audit_any_plt) != 0) { unsigned int altvalue = 0; struct audit_ifaces *afct = GLRO(dl_audit); /* Synthesize a symbol record where the st_value field is the result. */ ElfW(Sym) sym = *defsym; sym.st_value = DL_FIXUP_VALUE_ADDR (value); /* Keep track whether there is any interest in tracing the call in the lower two bits. */ assert (DL_NNS * 2 <= sizeof (reloc_result->flags) * 8); assert ((LA_SYMB_NOPLTENTER | LA_SYMB_NOPLTEXIT) == 3); reloc_result->enterexit = LA_SYMB_NOPLTENTER | LA_SYMB_NOPLTEXIT; const char *strtab2 = (const void *) D_PTR (result, l_info[DT_STRTAB]); for (unsigned int cnt = 0; cnt < GLRO(dl_naudit); ++cnt) { /* XXX Check whether both DSOs must request action or only one */ if ((l->l_audit[cnt].bindflags & LA_FLG_BINDFROM) != 0 && (result->l_audit[cnt].bindflags & LA_FLG_BINDTO) != 0) { unsigned int flags = altvalue; if (afct->symbind != NULL) { uintptr_t new_value = afct->symbind (&sym, reloc_result->boundndx, &l->l_audit[cnt].cookie, &result->l_audit[cnt].cookie, &flags, strtab2 + defsym->st_name); if (new_value != (uintptr_t) sym.st_value) { altvalue = LA_SYMB_ALTVALUE; sym.st_value = new_value; } } /* Remember the results for every audit library and store a summary in the first two bits. */ reloc_result->enterexit &= flags & (LA_SYMB_NOPLTENTER | LA_SYMB_NOPLTEXIT); reloc_result->enterexit |= ((flags & (LA_SYMB_NOPLTENTER | LA_SYMB_NOPLTEXIT)) << ((cnt + 1) * 2)); } else /* If the bind flags say this auditor is not interested, set the bits manually. */ reloc_result->enterexit |= ((LA_SYMB_NOPLTENTER | LA_SYMB_NOPLTEXIT) << ((cnt + 1) * 2)); afct = afct->next; } reloc_result->flags = altvalue; value = DL_FIXUP_ADDR_VALUE (sym.st_value); } else /* Set all bits since this symbol binding is not interesting. */ reloc_result->enterexit = (1u << DL_NNS) - 1; } #endif /* Store the result for later runs. */ if (__builtin_expect (! GLRO(dl_bind_not), 1)) *resultp = value; } /* By default we do not call the pltexit function. */ long int framesize = -1; #ifdef SHARED /* Auditing checkpoint: report the PLT entering and allow the auditors to change the value. */ if (DL_FIXUP_VALUE_CODE_ADDR (value) != 0 && GLRO(dl_naudit) > 0 /* Don't do anything if no auditor wants to intercept this call. */ && (reloc_result->enterexit & LA_SYMB_NOPLTENTER) == 0) { ElfW(Sym) *defsym = ((ElfW(Sym) *) D_PTR (reloc_result->bound, l_info[DT_SYMTAB]) + reloc_result->boundndx); /* Set up the sym parameter. */ ElfW(Sym) sym = *defsym; sym.st_value = DL_FIXUP_VALUE_ADDR (value); /* Get the symbol name. */ const char *strtab = (const void *) D_PTR (reloc_result->bound, l_info[DT_STRTAB]); const char *symname = strtab + sym.st_name; /* Keep track of overwritten addresses. */ unsigned int altvalue = reloc_result->flags; struct audit_ifaces *afct = GLRO(dl_audit); for (unsigned int cnt = 0; cnt < GLRO(dl_naudit); ++cnt) { if (afct->ARCH_LA_PLTENTER != NULL && (reloc_result->enterexit & (LA_SYMB_NOPLTENTER << (2 * (cnt + 1)))) == 0) { unsigned int flags = altvalue; long int new_framesize = -1; uintptr_t new_value = afct->ARCH_LA_PLTENTER (&sym, reloc_result->boundndx, &l->l_audit[cnt].cookie, &reloc_result->bound->l_audit[cnt].cookie, regs, &flags, symname, &new_framesize); if (new_value != (uintptr_t) sym.st_value) { altvalue = LA_SYMB_ALTVALUE; sym.st_value = new_value; } /* Remember the results for every audit library and store a summary in the first two bits. */ reloc_result->enterexit |= ((flags & (LA_SYMB_NOPLTENTER | LA_SYMB_NOPLTEXIT)) << (2 * (cnt + 1))); if ((reloc_result->enterexit & (LA_SYMB_NOPLTEXIT << (2 * (cnt + 1)))) == 0 && new_framesize != -1 && framesize != -2) { /* If this is the first call providing information, use it. */ if (framesize == -1) framesize = new_framesize; /* If two pltenter calls provide conflicting information, use the larger value. */ else if (new_framesize != framesize) framesize = MAX (new_framesize, framesize); } } afct = afct->next; } value = DL_FIXUP_ADDR_VALUE (sym.st_value); } #endif /* Store the frame size information. */ *framesizep = framesize; (*mcount_fct) (retaddr, DL_FIXUP_VALUE_CODE_ADDR (value)); return value; } #endif /* PROF && ELF_MACHINE_NO_PLT */ #include <stdio.h> void ARCH_FIXUP_ATTRIBUTE _dl_call_pltexit (struct link_map *l, ElfW(Word) reloc_arg, const void *inregs, void *outregs) { #ifdef SHARED /* This is the address in the array where we store the result of previous relocations. */ // XXX Maybe the bound information must be stored on the stack since // XXX with bind_not a new value could have been stored in the meantime. struct reloc_result *reloc_result = &l->l_reloc_result[reloc_index]; ElfW(Sym) *defsym = ((ElfW(Sym) *) D_PTR (reloc_result->bound, l_info[DT_SYMTAB]) + reloc_result->boundndx); /* Set up the sym parameter. */ ElfW(Sym) sym = *defsym; /* Get the symbol name. */ const char *strtab = (const void *) D_PTR (reloc_result->bound, l_info[DT_STRTAB]); const char *symname = strtab + sym.st_name; struct audit_ifaces *afct = GLRO(dl_audit); for (unsigned int cnt = 0; cnt < GLRO(dl_naudit); ++cnt) { if (afct->ARCH_LA_PLTEXIT != NULL && (reloc_result->enterexit & (LA_SYMB_NOPLTEXIT >> (2 * cnt))) == 0) { afct->ARCH_LA_PLTEXIT (&sym, reloc_result->boundndx, &l->l_audit[cnt].cookie, &reloc_result->bound->l_audit[cnt].cookie, inregs, outregs, symname); } afct = afct->next; } #endif }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
You can’t perform that action at this time.