simulating section-gc with ar-archives?

Ian Lance Taylor ian@airs.com
Thu Jan 17 23:12:00 GMT 2002


Adam Megacz <adam@megacz.com> writes:

> > However, breaking up a .o after the fact is not necessarily trivial,
> > and is in the general case impossible, because there is no way to
> > correctly handle references to file static variables and functions.
> 
> Interesting; will objcopy warn me if there is a problem when
> extracting a single section from a .o?

I doubt it, but who knows?

> Also, what is a "file static variable"? Wouldn't any references from
> one section to a static variable in another section be handled by a
> reloc with the symbol name of the static variable?

By file static variable, I mean something like `static int i;'.  Such
a symbol has no externally visible name--it can not have an externally
visible name, because there is no way to ensure that name is unique
across an entire program.  Without an externally visible name, there
is no way to resolve a reference from one .o file to another.

Ian



More information about the Binutils mailing list