1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

program headers linker script

Discussion in 'Embedded' started by Tom, May 7, 2004.

  1. Tom

    Tom Guest

    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
     
    Tom, May 7, 2004
    #1
    1. Advertisements

  2. 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
    ****-yous away from the actual code, is the best way I can think of putting
    it........
     
    Clark G. Smith, May 8, 2004
    #2
    1. Advertisements

  3. 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 Schick, May 10, 2004
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.