Is the creation of linux shared libraries consistent between linux x86_64 and arm64 architectures?

57 views Asked by At

I'm wondering if the way we create shared libraries is the same between these two architectures.

Let's say I have the file fx.c that contains some functions definitions so I would create a shared library like this :

gcc -fPIC -c fx.c -o fx.o

gcc -shared fx.o -o libtest.so

1)Is this way of creating shared libraries the same in x86_64 and arm64 ?

2)Is it true that shared libraries created in this way are shared by different processes and only one copy of it will reside in memory?

1

There are 1 answers

0
rostamn739 On

Yes, the command line options are the same between platforms, however as you dive deeper you find e.g. platform-specific relocations in ELF format object files (relocatables), linker script differences and eventually compiler driver options that can affect code generation