[oi-dev] What is the equivalent for GNU ld's --export-dynamic?

Bob Friesenhahn bfriesen at simple.dallas.tx.us
Wed Mar 24 18:43:50 UTC 2021


On Wed, 24 Mar 2021, cretin1997 via oi-dev wrote:
>
> I know the Solaris linker is what caused all of the trouble. 
> FreeBASIC expects a GNU linker. This time is the same. The Solaris 
> ld doesn't support --export-dynamic.

The Solaris linker has not caused a problem.  It seems like the Linux 
linker has caused the problem! :-)

I suggest trying without the option. If there is some problem later 
with resolving symbols while actually running the program, then return 
to the issue.

If one looks at the Linux dlopen(3) manual page, there is a 
RTLD_GLOBAL option.  Apparently this used to be the Linux default, 
then but then RTLD_LOCAL became the default due to security concerns. 
It is my experience that Illumos will still behave as described for 
RTLD_GLOBAL:

"The symbols defined by this shared object will be made available for 
symbol resolution of subsequently loaded shared objects."

> Put this shit aside, what I do is I just removed the problematic 
> option. FreeBASIC does turn on it option for Linux. I don't know 
> what it does, nor I wanted to know, I only wanted to know the 
> equivalent option for the Solaris linker. If no such equivalent 
> option available, does the shared library produced by FreeBASIC with 
> --export-dynamic removed work? What is the side effect if without 
> --export-dynamic? This is the only thing I wanted to know! The one 
> most qualified to answer such question should be the FreeBASIC 
> developers, but, as you already known... do it yourself and you 
> could submit the code to us!

Since you are porting the code, you will soon learn if it works.

Trial and error is a valid approach.

Bob
-- 
Bob Friesenhahn
bfriesen at simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
Public Key,     http://www.simplesystems.org/users/bfriesen/public-key.txt



More information about the oi-dev mailing list