This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Commit: _bfd_is_local_label_name: Include assembler local labels
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Tue, 7 Apr 2015 05:30:41 -0700
- Subject: Re: Commit: _bfd_is_local_label_name: Include assembler local labels
- Authentication-results: sourceware.org; auth=none
- References: <87384cck6h dot fsf at redhat dot com>
On Tue, Apr 7, 2015 at 3:22 AM, Nick Clifton <nickc@redhat.com> wrote:
> Hi Guys,
>
> I am checking in the patch below to update _bfd_is_local_label_name so
> that it includes assembler generated local labels.
>
> Cheers
> Nick
>
> bfd/ChangeLog
> 2015-04-07 Nick Clifton <nickc@redhat.com>
>
> * elf.c (_bfd_elf_is_local_label_name): Treat assembler generated
> local labels as local.
>
> diff --git a/bfd/elf.c b/bfd/elf.c
> index cbc0c91..bb5f1c6 100644
> --- a/bfd/elf.c
> +++ b/bfd/elf.c
> @@ -7743,6 +7743,10 @@ _bfd_elf_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED,
> if (name[0] == '_' && name[1] == '.' && name[2] == 'L' && name[3] == '_')
> return TRUE;
>
> + /* Treat assembler generated local labels as local. */
> + if (name[0] == 'L' && name[strlen (name) - 1] < 32)
> + return TRUE;
> +
> return FALSE;
> }
>
Do you have a testcase for this? I thought assembler generated local label
on ELF targets started with ".L", not "L".
--
H.J.