This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [patch] .comm & alignment bug
- To: Nick Clifton <nickc at redhat dot com>
- Subject: Re: [patch] .comm & alignment bug
- From: Denis Chertykov <denisc at overta dot ru>
- Date: 24 Aug 2000 19:55:42 +0400
- Cc: denisc at overta dot ru, binutils at sourceware dot cygnus dot com
- References: <200008222150.OAA23049@elmo.cygnus.com>
Nick Clifton <nickc@redhat.com> writes:
[...]
> I agree that this is a bug, but I think that the patch you are
> proposing is wrong since if no alignment was specified for the symbol
> 'sym.st_value' will be 0, which will result in 'align' being zero (*),
> which will cause 'alignment_power' to be set to zero (assuming
> old_alignment is also zero). This is incorrect since the spec says
> that if no alignment is specified its alignment will be:
>
> ... the largest power of two less than or equal to the size of the
> symbol, up to a maximum of 16.
Generally I'm agree with you, but:
gas info says:
................................... If no alignment is specified, `as'
will set the alignment to the largest power of two less than or equal
to the size of the symbol, up to a maximum of 16.
So, assembler calculates default alignment.
As I understand `sym.st_value' can't be 0 in link time.
> Instead I would suggest the following, which is only slightly
> different, and which should have the desired effect whilst making it
> clear that 'align' is overriding the default alignment because an
> alignment of 1 was requested and there are no other definitions of the
> symbol with greater alignment requirements.
>
> Please could you test this and let me know if it works for you. If it
> does then I will check the patch in.
Your modified patch works.
Please apply.
Denis.
PS:
> (*) bfd_log2 (0) == bfd_log2 (1) == 0 !!!
IMHO: bfd_log2 (0) not happened in link time.