reducing reloc syms to section syms

John Reiser jreiser@BitWagon.com
Tue May 7 23:11:00 GMT 2002


> Is there any benefit in reducing just some relocs using a given symbol
> to the section symbol, and not others?

If all the relocations that refer to a given symbol are reduced to the
corresponding section symbol, then the scope ("globalness") of the given
symbol can be changed [usually: reduced] without altering the current
effective values of the text that is being relocated.  This is exceedingly
handy for implementing a "divide and conquer" strategy when constructing
a system out of subsystems.  The desired property is that aggregation of
subsystems into a larger unit does not change the internal behavior of
any subsystem.  Behavior that was verified in isolated unit testing,
remains the same when aggregated.  Much like a version script controls
visibility of symbols that "just happen" to be global as a result
of the artifact of compiling separate source files, so also strength
reduction from symbol name to section name controls the affect of
subsequent relocation which now references a symbol that "just happens"
to be global.  (That is: I want the option to reduce relocation
strength as much as possible [symbol==>section==>done] on a symbol-by-
symbol basis.)

-- 
John Reiser, jreiser@BitWagon.com



More information about the Binutils mailing list