Issue
In Visual Studio I can get specific symbols exported from a dll using /INCLUDE (Force Symbol References) Linker option. Is there an equivalent option in GCC?
I'm compiling with -fvisibility=hidden so no symbol is exported by default.
Solution
While symbols visibility might work, it is not quite the answer to the question asked. It is not a linker option, and requires source modifications, which might be undesirable. More or less equivalent is export map, but it is only available for GCC with GNU linker. GCC command-line option would be
-Wl,--version-script=a.map
with a.map looks like
{
global: a;
local: *;
}
more info at http://www.akkadia.org/drepper/dsohowto.pdf
Answered By - Severin Pappadeux Answer Checked By - Dawn Plyler (WPSolving Volunteer)