Author Topic: howto filter dll exported symbols?  (Read 3517 times)

ochnap2

  • Guest
howto filter dll exported symbols?
« on: April 10, 2007, 08:18:09 pm »
Hi, I'm trying to use "-Wl,--version-script=xyz.map" to filter the symbols exported from a dll, but I can't make it work (everything gets exported). Is possible to use it on Code::Blocks+Cygwin+Windows?

I added the version script command to the "Other linker options" of the "Linker Settings" of the "Project build options" dialog. I know the options are being added to the linker invocation and that the version script is being read because syntax errors in the script make the link fail, but anyway everything gets exported as I said.

I found this technique in http://people.redhat.com/drepper/dsohowto.pdf. I tried also the attribute visibility trick but it seems it's not yet supported by the gcc compiler in Cygwin and the libtool method is not applicable because Code::Blocks doesn't use libtool. So... any advice regarding will be welcome! :)

TIA,
Och


Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: howto filter dll exported symbols?
« Reply #1 on: April 10, 2007, 08:22:24 pm »
I know the options are being added to the linker invocation and that the version script is being read because syntax errors in the script make the link fail, but anyway everything gets exported as I said.
This being the case, I'm afraid your question is pretty much unrelated to Code::Blocks. I'm not familiar with Cygwin myself, nor this particular linker option in general, so I can't help you. Your question would be best directed toward whoever distributed the version of binutils being used -- the Cygwin mailing lists or forums, I expect.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

ochnap2

  • Guest
Re: howto filter dll exported symbols?
« Reply #2 on: April 11, 2007, 01:32:19 pm »
Hi TDragon, thanks for your fast response. Anyway I found the way to do it: just add __declspect(dllexport) to the declaration of the exported functions (as with MSVC...). Tested and it works. Found it here:

http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/gnu-linker/win32.html

Thanks!
Och