Linker script to duplicate input sections

Michael Hennebry hennebry@web.cs.ndsu.nodak.edu
Fri Aug 28 00:01:00 GMT 2009


On Thu, 27 Aug 2009, Dobes wrote (quoted ooo):
>
> Michael Hennebry wrote:
>>
>> You might need to use objcopy to produce another file to link.

> But then how do I avoid the multiple definition errors?

What would you want to happen?
You seem to want them defined twice.

For symbols not referenced from outside,
you might be able to localize the symbols.
objcopy's --localize-symbol will do it for one symbol.
I don't know how to do it en masse.
There is also a --globalize-symbol .

For references to the duplicated section from outside,
there is no obvious right thing.
For each symbol, you will need to pick one.

-- 
Michael   hennebry@web.cs.ndsu.NoDak.edu
"Pessimist: The glass is half empty.
Optimist:   The glass is half full.
Engineer:   The glass is twice as big as it needs to be."



More information about the Binutils mailing list