2007-07-05

[gcc] -rdynamic

> BTW, why is it that the -soname option and the -rdynamic
> option are not in the man page for gcc?

Essentially because they are really linker options, passed by gcc down to
ld. This is strictly true for -soname: the comma-separated list
following -Wl option of gcc is passed directly to the linker, after
replacing the commas with spaces (you can see this if you gcc -v). No
other processing is done on it by the compiler proper.

The -rdynamic option is slightly different. It seems to have been
introduced as a high-level interface to the linker, to (a) force the
allocation of a global symbol table in the final executable, even if it's
not strictly needed, and (b) cause the inclusion of the global symbols in
that symbol table.

  • Under linux, gcc interprets it by setting the "-export-dynamic" option for ld, which has that effect, according to the linux ld manpage.
  • Under IRIX it's ignored, and the program's happy as a clam.
  • Under SunOS-4.1, gcc interprets it by setting the -dc -dp options for ld, which again forces the allocation of the symbol table in the code produced (see ld(1) on a Sun).

Wonder if we should mailbomb gcc-bug@gnu.org until they fix their man/info
pages ;-)

-- From http://www.cim.mcgill.ca/~franco/OpSys-304-427/messages/node59.html

No comments: