mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-27 22:48:57 +08:00
Extend test for local labels to include fake symbols and local labels with a numeric suffix.
* elf.c (_bfd_elf_is_local_label_name): Extend test for assembler local labels to include local labels with a numeric suffix and fake symbols.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2015-04-24 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
|
* elf.c (_bfd_elf_is_local_label_name): Extend test for assembler
|
||||||
|
local labels to include local labels with a numeric suffix and
|
||||||
|
fake symbols.
|
||||||
|
|
||||||
2015-04-24 H.J. Lu <hongjiu.lu@intel.com>
|
2015-04-24 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
PR binutils/18316
|
PR binutils/18316
|
||||||
|
41
bfd/elf.c
41
bfd/elf.c
@ -7930,10 +7930,47 @@ _bfd_elf_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED,
|
|||||||
if (name[0] == '_' && name[1] == '.' && name[2] == 'L' && name[3] == '_')
|
if (name[0] == '_' && name[1] == '.' && name[2] == 'L' && name[3] == '_')
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
/* Treat assembler generated local labels as local. */
|
/* Treat assembler generated fake symbols, dollar local labels and
|
||||||
if (name[0] == 'L' && name[strlen (name) - 1] < 32)
|
forward-backward labels (aka local labels) as locals.
|
||||||
|
These labels have the form:
|
||||||
|
|
||||||
|
L0^A.* (fake symbols)
|
||||||
|
|
||||||
|
[.]?L[0123456789]+{^A|^B}[0123456789]* (local labels)
|
||||||
|
|
||||||
|
Versions which start with .L will have already been matched above,
|
||||||
|
so we only need to match the rest. */
|
||||||
|
if (name[0] == 'L' && ISDIGIT (name[1]))
|
||||||
|
{
|
||||||
|
bfd_boolean ret = FALSE;
|
||||||
|
const char * p;
|
||||||
|
char c;
|
||||||
|
|
||||||
|
for (p = name + 2; (c = *p); p++)
|
||||||
|
{
|
||||||
|
if (c == 1 || c == 2)
|
||||||
|
{
|
||||||
|
if (c == 1 && p == name + 2)
|
||||||
|
/* A fake symbol. */
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
/* FIXME: We are being paranoid here and treating symbols like
|
||||||
|
L0^Bfoo as if there were non-local, on the grounds that the
|
||||||
|
assembler will never generate them. But can any symbol
|
||||||
|
containing an ASCII value in the range 1-31 ever be anything
|
||||||
|
other than some kind of local ? */
|
||||||
|
ret = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! ISDIGIT (c))
|
||||||
|
{
|
||||||
|
ret = FALSE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user