Currently external linking on ELF systems passes -rdynamic to the external linker, which tells it to put all exported symbols into the dynamic symbol table. This is unnecessary in the normal case. It wastes space in the executable, and effectively disables garbage collection in the external linker. We should instead only export symbols that may need to be exported.
I have a patch for this which we can try for the 1.20 release.
The text was updated successfully, but these errors were encountered:
Re "how long can the command line get": instead of --export-dynamic-symbol we have also been using --dynamic-list and put all the to-be-exported symbols in a file. That flag too might not be universally available, though.
I don't think we can safely use --dynamic-list, as it is documented to set the complete list of dynamic symbols. That is, symbols not in the list are not put in the dynamic symbol table. We aren't going to know what symbols in C code should be in the dynamic symbol table.