Error for the second binding (.local/.weak/.globl)
Alan Modra
amodra@gmail.com
Wed Mar 25 22:53:29 GMT 2020
On Wed, Mar 25, 2020 at 02:46:22PM -0700, Fangrui Song wrote:
> On 2020-03-25, Alan Modra wrote:
> > On Tue, Mar 24, 2020 at 10:36:01PM -0700, Fangrui Song wrote:
> > > .weak (config/obj-elf.c) apparently overrides .globl (read.c) and .local
> > > (config/obj-elf.c) but this seems accidental rather than intentional.
> >
> > No, it was deliberate. git commit 5ca547dc239.
>
> Ian does not remember what problems the commit fixed. He wouldn't have
> done it on a whim.
gas emitted an error prior to that patch. Quite likely it was due to
gcc at that time emitting both .global and .weak, or .local and .weak,
under some condition.
> Maybe we can revisit the decision after 24 years.
I think it is completely fine for you to make the llvm assembler error
on inconsistent binding, or the last directive win. Either of those
behaviours is logical and good, but you quite possibly will run into a
need to fix more user assembly.
I also think it OK to leave gas as is, given that we have been that
way for many years without complaint, but I won't object if one of the
other global maintainers thinks we should change.
--
Alan Modra
Australia Development Lab, IBM
More information about the Binutils
mailing list