This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Partial symbol export vs --export-dynamic



Dear binutils experts,

I am running into a problem with binutils on Linux/x86. The IRIX
linker accepts an option called -exports_file filename, where
filename points to a file of symbols to be exported. This is useful
for an application I am working on: this application supports DSO
plugins, and I wish to restrict the exported symbols available to
the plugins to only the plugin API exported by the application,
to avoid having a plugin mistakenly access symbols which are
private to the application.

It seems that GNU ld does not have equivalent functionality:
--export-dynamic is an all-or-nothing option, which doesn't
really do what I want:

- exporting all of the application symbols grows the debug binary by 5MB
- it fails to hide non-API symbols, potentially causing problems for wayward
  plugins
- I seem to be getting symbol collisions with other DSOs which are being
  dlopened by system libraries

So I have a couple of questions:

- does the ELF format on Linux support exporting only some of the application
  symbols, or does it have to all-or-nothing?
- how painful would it be for me to add this functionality to ld/bfd,
  or is this a project way beyond the scope of a binutils novice?

Thanks in advance,
JF Panisset


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]