ILD

-rdynamic -Wl,--no-as-needed 选项
作者:Herbert Yuan 邮箱:yuanjp89@163.com
发布时间:2019-3-31 站点:Inside Linux Development

-rdynamic

Pass the flag ‘-export-dynamic’ to the ELF linker, on targets that support

it. This instructs the linker to add all symbols, not only used ones, to the

dynamic symbol table. This option is needed for some uses of dlopen or to

allow obtaining backtraces from within a program.


rdynamic传递-export-dynamic给ELF linker。指示将所有的符号放到dynamic symbol table,这对于使用dlopen的方式使用的符号很有帮助。


--as-needed

--no-as-needed

This option affects ELF DT NEEDED tags for dynamic libraries mentioned

on the command line after the ‘--as-needed’ option.

这是ld的选项,控制一个命令行中的lib是否放入DT_NEEDED,前者没如果lib没有被用到,则不放入。后者始终方式,不同的ld默认行为不一样。


Copyright © linuxdev.cc 2017-2024. Some Rights Reserved.