Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
1. compile a .o file, save to disk (on command line).
This .o has a statically initialized function table pointing to the public functions in the .o file
e.g.
------- from file1.c -----------
typedef int MY_ADD(int, int);
int my_add(int left, int right) { return left + right; }
2. The rest happens in a C program which is not linked to file1.o, but has declarations
for the needed types
3. open file1.o, copy to RAM
4. figure out where the data and object code resides in RAM
5. get a pointer to my_table
6. fix up the function pointer in my_table to (re)point to my_add
7. call my_add from my C program, e.g. my_table->ft_add(left, right);
Why not simply use a shared lib, kernel module, etc and let the kernel do the relocation? Because I want to make some code available to a booting kernel _before_ it has come up enough to load such things on its own.
I'm looking at the ELF format and can parse the headers and string tables. Before I delve into the symbol table, I'd like to see if there's a better/easier way.
Is there an objcopy switch(es) that would give me a raw binary image that would be better to parse than ELF?
Will I have problems from the memory manager since the code isn't necessarily loaded in an "ok to execute" area?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.