program headers linker script

May 07, 2004 2 Replies

Hi,



I read the section about headers in the gnu linker document. But it remains a mystery to me. Why would you use headers. When do you decide that a section gets assigned to a new program header ?



Tom


by "headers", I assume you mean a header, or a *.h file... if you will ever notice, a header file (although I have seen this abused), never contains executable code, just compiler directives (those are the things that start with a # sign, such as #define, #pragma, #include, etc.) .......... i have seen executable code in a header file, but i personally consider it very bad practice.. Why would you use headers? to keep your little compiler f*ck-yous away from the actual code, is the best way I can think of putting it........

The headers are needed for loading. The simplest is you have a text,data and bss section in your file. But if you have something special in your file, you might want to tell the loader where to find it (e.g. a relocation table).

42Bastian Do not email to bastian42@yahoo.com, it's a spam-only account :-) Use @epost.de instead !

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required