Re: C Linker/Compiler question

Bengt Farre <cosmic@cosmic-software.se>
12 May 2000 22:33:12 -0400

          From comp.compilers

Related articles
C Linker/Compiler question frgirard@globetrotter.net (Francis Girard) (2000-04-20)
Re: C Linker/Compiler question jhallen@world.std.com (2000-04-25)
Re: C Linker/Compiler question agold@bga.com (Arthur H. Gold) (2000-04-25)
Re: C Linker/Compiler question frgirard@globetrotter.net (Francis Girard) (2000-04-26)
Re: C Linker/Compiler question agold@bga.com (Arthur H. Gold) (2000-04-30)
Re: C Linker/Compiler question jaxon@soltec.net (Greg Jaxon) (2000-04-30)
Re: C Linker/Compiler question eeide@cs.utah.edu (Eric Eide) (2000-05-04)
Re: C Linker/Compiler question cosmic@cosmic-software.se (Bengt Farre) (2000-05-12)
| List of all articles for this month |

From: Bengt Farre <cosmic@cosmic-software.se>
Newsgroups: comp.compilers
Date: 12 May 2000 22:33:12 -0400
Organization: A Customer of Tele2
References: 00-04-150 00-04-174 00-04-187 00-04-226
Keywords: linker

I guess that you are attempting to do private binding.
Some compilers linkers use this for data/method hiding.


This is also used with compilers/linkers for the embedded market
where you want to do bankswitching with as little overhead as possible.


Private Name Regions. (excerpt from our linker manual)
>>


An explicit use for private name regions in an environment is in
building a paged program with duplication of the most used library
functions in each page, in order to avoid extra page commutation.


To avoid complaints when multiple copies of the same file redefine
symbols, each such contribution is placed in a private name region
accessible only to other files in the same page.


+new <public files> +pri <private libraries>


where <public files> contains symbols to be known outside this
private region, any symbols known in <private libraries> are known
only within this region.


<<


This is also useful to provide a symbol with an alias and to hide
the original name.


you have a method "F" to call,
so you define your library function "F"
that calls the old "F" under another name like "HIDDEN_F"
This "F" may do some other things I guess.


+new // make a new name region
Someotherpublic.o
+def _HIDDEN_F=_F // makes the alias HIDDEN_F of F
+pri // start private area
func.o // contains a F, could also be a library.
+new // make a new region and
// closes the previous region which hides F!
prog.o
newfunc.o // hey here is the F to be called instead.
// andthen calls HIDDEN_F




Bengt Farre
COSMIC Software Scandinavia


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.