x86_64: is there an option to always do RIP relative addressing for globals?

Mike Cui cuicui@gmail.com
Sun Jan 23 19:45:00 GMT 2011

> I think you can get approximately what you want by using "#pragma GCC
> visibility push(protected)" at the start of some header file to give all
> symbols, including all external symbols, protected visibility.  Then
> compile with -fpic.  I don't know if that will cover all cases.  It
> seems like kind of a special purpose requirement.

Awesome! That seems to do exactly what I want! Thanks!

More information about the Gcc-help mailing list