linux - I need to link C program on a shared object with no section headers -


I have written an interface for the code generator which generates a shared object. Although I do not want to apply support for the section headers table because there is a large number of ALF file formats in that place.

GNU LDI uses section headers to link with shared headers. This means that when I try to link GCC with a section header against my shared object, it will fail because Lynde has not found the symbols even if it is not present in the library.

The trick can be used to fool the compiler to make linking successful, even if it does not get some symbols?

There are some explanations for this problem:

  cheery @ ruttunen: ~ / document / g386 $ gcc dev / share_test c-l -based-m32 / tmp / cc6qBViY .o: function in `main ': shared_test.c :( text + 0xa): Undefined context for` Example_forcury' collection2: ld 1 to exit status @ rutunen: ~ / document / g-386 $ Cat dev / shared_test.c // GCC shared_test.cL -Lashid -M32 / LD_LIBRARY_PATH = ./a.out # include & lt; Stdio.h & gt; Extern int example_function (); Int main () {printf ("Hello% d \ n", example_function ()); } Cheery @ ruttunen: ~ / document / g386 $ readelf -D -s libshared.so Symbol table for image: Number Buc: Value size type Tie footage NDX name 2 0: 00800164 0 FUNC global default ABS example _ Task 0 0: 008000ac 0 Object Global Default ABS _DYNAMIC  

In GCC (behind the GCC) A command line is the option to ignore the unresolved interval. He will press the error message received from GCC. I'm not sure he is going to make you happy.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -