7.13

A.

libm.a path

whereis libm.a

output:

libm: /usr/lib64/libm.a /usr/lib64/libm.so

libm.a files

ar t /usr/lib64/libm.a

output:

s_lib_version.o
s_matherr.o
s_signgam.o
fclrexcpt.o
fgetexcptflg.o
fraiseexcpt.o
fsetexcptflg.o
ftestexcept.o
fegetround.o
fesetround.o
fegetenv.o
feholdexcpt.o
fesetenv.o
feupdateenv.o
t_exp.o
fedisblxcpt.o
feenablxcpt.o
fegetexcept.o
powl_helper.o
e_acos.o
e_acosh.o
e_asin.o
e_atan2.o
e_atanh.o
....

similar way for libc.a

B.

compile code with -Og and -Og -g

/*
 * little.c
 */
int main(int argc, char* argv[]) {
  return 0;
}


(cd chapter7/code/7.13; make && make dump-exe-code)
# objdump -d og-little
# objdump -d dog-little

they are same

C.

ldd og-little

output:

linux-vdso.so.1 (0x00007ffef51d3000)
libc.so.6 => /lib64/libc.so.6 (0x00007f27c6b8b000)
/lib64/ld-linux-x86-64.so.2 (0x00007f27c6f24000)
comments powered by Disqus