This is the mail archive of the
mailing list for the binutils project.
Re: Section symbols not getting created. Bug? Is attached patch correct fix?
John Marino wrote:
Alan Modra wrote:
On Tue, Apr 05, 2011 at 09:36:47PM +0200, John Marino wrote:
It appears that exp_provide() function used there discards the
symbols assigned "." and exp_assign() function does not.
No, the difference between exp_provide and exp_assign is that the
former won't define the symbol unless it is referenced. So if you are
expecting to see these symbols post-link, then you should reference
them from object files or via -u command line options.
Ah, ok, I'll investigate where this file is built and see if we can
handle it with an unmodified binutils and a change to the makefile.
Sometime between 2.17 and 2.20, the behavior changed with regards to
symbol definition but I guess that happens from time to time.
So apparently the patch I provided earlier is actually from the 2.17
version of ldlang.c where the lang_insert_orphan uses exp_assign(), and
then for some reason it was changed to the current version.
The example shown in BR 12641 uses the -Bshareable switch, so making the
assumption that all the symbols aren't used with this switch enabled is
perhaps a bad one.
Secondly there are numerous __start_* __stop_* in several modules, so to
individually declare each one in the command line would tiresome and
error prone. It is intentional that these sections are unused, but
referenced externally by the DragonFly loader.
At the very least, shouldn't there be a switch that could be used to
override the current behavior and go back to the original behavior?
What was the rationale for making this breaking change in the first place?