Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2006-07

linking an fpc .o file without common symbols?

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

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

Reply by email

Peter Vreman
to Daniel Purcell
you wrote 17 lines
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

Reply by email