linking an fpc .o file without common symbols?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

linking an fpc .o file without common symbols?

Daniel Purcell
I'm new to free-pascal, and have searched for a few hours without
finding an answer to my question.  I hope someone on the list could
please help point me in the right direction.

I've been using a couple of encryption/decryption units that are written
in Pascal that I've been using in a userspace networking tool for some
time.  For performance reasons, I want to move those routines out of
userspace and implement an iptables match (Linux kernel module) and
invoke the pascal routine.  After much trial and error, I have
successfully compiled a Linux kernel module, my fpc-generated .o file,
system.o and objpas.o together.  However, when I load the module, the
kernel refuses it because it contains common symbols, and suggests that
I recompile with the "-fno-common" flag (gcc flag?).  After some
research, nm system.o shows 30 or so symbols marked as ' C ', for
common.  Is there any way for me to tell the fpc compiler to re-compile
system.o and initialize the 30 or so symbols so that they won't be
marked as "common"?

-Dan

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: linking an fpc .o file without common symbols?

Peter Vreman
At 22:18 24-7-2006, you wrote:

>I'm new to free-pascal, and have searched for a few hours without
>finding an answer to my question.  I hope someone on the list could
>please help point me in the right direction.
>
>I've been using a couple of encryption/decryption units that are
>written in Pascal that I've been using in a userspace networking
>tool for some time.  For performance reasons, I want to move those
>routines out of userspace and implement an iptables match (Linux
>kernel module) and invoke the pascal routine.  After much trial and
>error, I have successfully compiled a Linux kernel module, my
>fpc-generated .o file, system.o and objpas.o together.  However,
>when I load the module, the kernel refuses it because it contains
>common symbols, and suggests that I recompile with the "-fno-common"
>flag (gcc flag?).  After some research, nm system.o shows 30 or so
>symbols marked as ' C ', for common.  Is there any way for me to
>tell the fpc compiler to re-compile system.o and initialize the 30
>or so symbols so that they won't be marked as "common"?

There is no option for it.


Peter

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal