www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/07/21/07:03:52

Xref: news2.mv.net comp.os.msdos.djgpp:6216
From: malcolm AT manawatu DOT gen DOT nz (Malcolm Taylor)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Relocation and linking
Date: Sun, 21 Jul 1996 07:49:21 GMT
Organization: Grafik Software
Lines: 31
Message-ID: <4ssre2$bo0@news.manawatu.gen.nz>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 960712095335 DOT 2883A-100000 AT faust>
Reply-To: malcolm AT manawatu DOT gen DOT nz
NNTP-Posting-Host: malcolm.manawatu.gen.nz
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019