This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Missing use of LOCAL_LABEL_PREFIX in _bfd_elf_is_local_label_name
- From: Ian Lance Taylor <iant at google dot com>
- To: "David Stubbs" <stubbs at IceraSemi dot com>
- Cc: <binutils at sourceware dot org>, "sdkteam-gnu" <sdkteam-gnu at IceraSemi dot com>
- Date: Fri, 09 Apr 2010 07:50:20 -0700
- Subject: Re: Missing use of LOCAL_LABEL_PREFIX in _bfd_elf_is_local_label_name
- References: <4D60B0700D1DB54A8C0C6E9BE69163700E4E10EC@EXCHANGEVS.IceraSemi.local>
"David Stubbs" <stubbs@IceraSemi.com> writes:
> Index: bfd/elf.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/elf.c,v
> retrieving revision 1.506
> diff -u -p -r1.506 elf.c
> --- bfd/elf.c 17 Mar 2010 13:46:35 -0000 1.506
> +++ bfd/elf.c 9 Apr 2010 09:12:42 -0000
> @@ -7101,6 +7101,11 @@ bfd_boolean
> _bfd_elf_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED,
> const char *name)
> {
> +#ifdef LOCAL_LABEL_PREFIX
> + if (name[0] == LOCAL_LABEL_PREFIX)
> + return TRUE;
> +#endif
> +
> /* Normal local symbols start with ``.L''. */
> if (name[0] == '.' && name[1] == 'L')
> return TRUE;
This is wrong. BFD can support many targets at once, and those
targets can have different local label prefixes. You can't test a
preprocessor macro here.
The right approach is to add a bfd_elf32_bfd_is_local_label_name hook
for your target; e.g., corresponding to Andreas's patch, see the one
in bfd/elf32-s390.c.
Ian