This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH/RFA] Fix C-referenceable sections with explicit LMAs
On Wed, Dec 11, 2002 at 08:54:31AM +1030, Alan Modra wrote:
> Orphans are not "merged into the sections". They have separate output
> sections. This part of your patch is just plain wrong, and will
> likely break SIZEOF for other people. I've shown you the way to
> correct your linker scripts to do what you want, yet you persist in
> trying to change the meaning of SIZEOF. Why?
Probably because the current behavior violates the Principle of Least
Surpise. It is going to create a support nightmare because now we have
to tell existing users "Oh, you have to make this change to all of your
linker scripts because the new version of a library you might use takes
advantage of this obscure linker feature".
Also, the suggestion you made is not necessarily equivalent to using
SIZEOF, and could result in producing less-compact (in terms of how
much disk/flash/whatever storage space they occupy) executables. It
happens to work for placing the orphans, but you're effectively telling
me that I cannot use SIZEOF *at all* in my linker scripts, and your method,
if used e.g. to specify the LMA of .data, is going to account for whatever
padding is required between end of .text and start of .data for VMA, which
is definitely not necessarily what you want if you're trying to produce a
nice, small flash image.
I don't see how it could actually break SIZEOF for other people (it's
very clear that I am the first person to actually try to use both of
these linker features at the same time), because there is *no other way*
to represent those orphan sections and still have the __start_SECNAME/
__stop_SECNAME or the "create arbitrary numbers of these sections and not
have to update the linker script" feature work properly. Because
if this, the orphans, when they are sorted with another, representable
section, *effectively do change the size of that section*.
Apologies for using the word "merged" .. you're correct, they are not
actually merged ... but the *effect* is as if they were, save the Shdr
and marker symbols for the orphan.
-- Jason R. Thorpe <email@example.com>