It usually winds up in a section with a name like
.text.__i686.get_pc_thunk.bx. It doesn't necessarily wind up in the
.text section, though it should certainly be in the text segment. In
any case, you readelf -s to see whether and where it is defined.
Ian
First, thanks for your reply. I havn't expected to get answer from the blog
author :)
Are you mean to list symbols info with "readelf -s ./libsub.so" ?? There
isn't the
symbol in the output.
Apropos of .text.__i686.get_pc_thunk.bx section. I found there is something
like this in
the source code of glibc, in ./sysdeps/unix/sysv/linux/i386/sysdep.h:
# ifndef HAVE_HIDDEN
# define SETUP_PIC_REG(reg) \
call 1f;
\
.subsection 1;
\
1:movl (%esp), %e##reg;
\
ret;
\
.previous
# else
# define SETUP_PIC_REG(reg) \
.section .gnu.linkonce.t.__i686.get_pc_thunk.reg,"ax",@progbits;
\
.globl __i686.get_pc_thunk.reg;
\
.hidden __i686.get_pc_thunk.reg;
\
.type __i686.get_pc_thunk.reg,@function;
\
__i686.get_pc_thunk.reg:
\
movl (%esp), %e##reg;
\
ret;
\
.size __i686.get_pc_thunk.reg, . - __i686.get_pc_thunk.reg;
\
.previous;
\
call __i686.get_pc_thunk.reg
# endif
It seems that the __i686.get_pc_thunk.bx is definded in section
.gnu.linkonce.t.__i686.get_pc_thunk.bx. Is this true??
When using "readelf -l ./libsub.so", I haven't found one section named like
this in
.text segment. So is the section .gnu.linkonce.t.__i686.get_pc_thunk.bx. got
deleted
in linking process? I'm not sure of this, but there is a "linkonce" in the
name of the section.