0

I wrote a program in Rust. When compiled, it requires glibc symbols as well as secure_getenv.

objdump -T ~/Downloads/redisql_v1.0.1_x86_64.so | grep secure -C 3
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 rewind
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 bind
0000000000000000      D  *UND*  0000000000000000              secure_getenv ### <--- here
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 socket
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 pthread_mutex_trylock

How can I tell which dependencies require this specific function?

Shepmaster
  • 326,504
  • 69
  • 892
  • 1,159
Siscia
  • 1,349
  • 1
  • 10
  • 26
  • Edited to remove the C part. Usually this kind of things are related to the executable, not the language that is used to write it. I was asking how to determine why a specific symbol is needed in a binary written in plain old C. – Siscia Jun 04 '19 at 17:13
  • Because it's used, directly or indirectly? – Dave Newton Jun 04 '19 at 17:14
  • @Dave, it is used by a dependencies... Which one I don't know and I would like to found out. – Siscia Jun 04 '19 at 17:15

1 Answers1

1

How can I tell which dependencies require this specific function?

You can find out which code referenced it by adding -Wl,-y,secure_getenv to the link line.

Employed Russian
  • 182,696
  • 29
  • 267
  • 329
  • Combined with [How can I specify linker flags/arguments in a build script?](https://stackoverflow.com/q/50642574/155423) – Shepmaster Jun 06 '19 at 02:43