Mail Archives: djgpp/1996/07/21/07:03:52
Nicola Gaggi <gaggi AT cs DOT unibo DOT it> wrote:
>hello,
>I am looking for informations on relocation and linking under djgpp.
>I have read the include file 'coff.h' in order to understand the format
>of the COFF file, but I was not able to understand how static and locally
>defined symbols are handled.
>Would you give me an help?
Static symbols are stored in the data and bss (.data and .bss sections
of the coff file respectively). The initialised static data (ie static
data that has been given an initial value) is in the data segment and
uninitialised in the bss. The symbols are only in the coff file if you
have compiled with debug info enabled, otherwise there are only the
symbols required to link to the object, and none of these are given a
type (they have type 0). There is also one other type of static data
which is called common. The djgpp linker script file will put these in
the bss section. These symbols are allocated a certain amount of space
only, no position is given for them in any section.
Local symbols never get put in a coff file except for the start of
function, end of function symbols, and the section symbols (symbols
pointing to the start of the .text, .data and .bss section for the
given object file) which are normally used for the relocation
information (as reference points for any relocations).
I hope this helps.
Malcolm
- Raw text -