Missing use of LOCAL_LABEL_PREFIX in _bfd_elf_is_local_label_name
Ian Lance Taylor
iant@google.com
Fri Apr 9 14:50:00 GMT 2010
"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
More information about the Binutils
mailing list