This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: simulating section-gc with ar-archives?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]