mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-04 12:31:38 +08:00
aarch64: handle .variant_pcs directive in gas
In ELF objects the specified symbol is marked with STO_AARCH64_VARIANT_PCS. gas/ChangeLog: * config/tc-aarch64.c (s_variant_pcs): New function. * doc/c-aarch64.texi: Document .variant_pcs. * testsuite/gas/aarch64/symbol-variant_pcs-1.d: New test. * testsuite/gas/aarch64/symbol-variant_pcs-1.s: New test. * testsuite/gas/aarch64/symbol-variant_pcs-2.d: New test. * testsuite/gas/aarch64/symbol-variant_pcs-2.s: New test.
This commit is contained in:
@ -1,3 +1,12 @@
|
|||||||
|
2019-05-24 Szabolcs Nagy <szabolcs.nagy@arm.com>
|
||||||
|
|
||||||
|
* config/tc-aarch64.c (s_variant_pcs): New function.
|
||||||
|
* doc/c-aarch64.texi: Document .variant_pcs.
|
||||||
|
* testsuite/gas/aarch64/symbol-variant_pcs-1.d: New test.
|
||||||
|
* testsuite/gas/aarch64/symbol-variant_pcs-1.s: New test.
|
||||||
|
* testsuite/gas/aarch64/symbol-variant_pcs-2.d: New test.
|
||||||
|
* testsuite/gas/aarch64/symbol-variant_pcs-2.s: New test.
|
||||||
|
|
||||||
2019-05-24 Alan Modra <amodra@gmail.com>
|
2019-05-24 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
* po/POTFILES.in: Regenerate.
|
* po/POTFILES.in: Regenerate.
|
||||||
|
@ -1936,6 +1936,28 @@ s_aarch64_elf_cons (int nbytes)
|
|||||||
demand_empty_rest_of_line ();
|
demand_empty_rest_of_line ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Mark symbol that it follows a variant PCS convention. */
|
||||||
|
|
||||||
|
static void
|
||||||
|
s_variant_pcs (int ignored ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
char *name;
|
||||||
|
char c;
|
||||||
|
symbolS *sym;
|
||||||
|
asymbol *bfdsym;
|
||||||
|
elf_symbol_type *elfsym;
|
||||||
|
|
||||||
|
c = get_symbol_name (&name);
|
||||||
|
if (!*name)
|
||||||
|
as_bad (_("Missing symbol name in directive"));
|
||||||
|
sym = symbol_find_or_make (name);
|
||||||
|
restore_line_pointer (c);
|
||||||
|
demand_empty_rest_of_line ();
|
||||||
|
bfdsym = symbol_get_bfdsym (sym);
|
||||||
|
elfsym = elf_symbol_from (bfd_asymbol_bfd (bfdsym), bfdsym);
|
||||||
|
gas_assert (elfsym);
|
||||||
|
elfsym->internal_elf_sym.st_other |= STO_AARCH64_VARIANT_PCS;
|
||||||
|
}
|
||||||
#endif /* OBJ_ELF */
|
#endif /* OBJ_ELF */
|
||||||
|
|
||||||
/* Output a 32-bit word, but mark as an instruction. */
|
/* Output a 32-bit word, but mark as an instruction. */
|
||||||
@ -2082,6 +2104,7 @@ const pseudo_typeS md_pseudo_table[] = {
|
|||||||
{"long", s_aarch64_elf_cons, 4},
|
{"long", s_aarch64_elf_cons, 4},
|
||||||
{"xword", s_aarch64_elf_cons, 8},
|
{"xword", s_aarch64_elf_cons, 8},
|
||||||
{"dword", s_aarch64_elf_cons, 8},
|
{"dword", s_aarch64_elf_cons, 8},
|
||||||
|
{"variant_pcs", s_variant_pcs, 0},
|
||||||
#endif
|
#endif
|
||||||
{0, 0, 0}
|
{0, 0, 0}
|
||||||
};
|
};
|
||||||
|
@ -439,6 +439,12 @@ should only be done if it is really necessary.
|
|||||||
|
|
||||||
@c VVVVVVVVVVVVVVVVVVVVVVVVVV
|
@c VVVVVVVVVVVVVVVVVVVVVVVVVV
|
||||||
|
|
||||||
|
@cindex @code{.variant_pcs} directive, AArch64
|
||||||
|
@item .variant_pcs @var{symbol}
|
||||||
|
This directive marks @var{symbol} referencing a function that may
|
||||||
|
follow a variant procedure call standard with different register
|
||||||
|
usage convention from the base procedure call standard.
|
||||||
|
|
||||||
@c WWWWWWWWWWWWWWWWWWWWWWWWWW
|
@c WWWWWWWWWWWWWWWWWWWWWWWWWW
|
||||||
@c XXXXXXXXXXXXXXXXXXXXXXXXXX
|
@c XXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||||
|
|
||||||
|
10
gas/testsuite/gas/aarch64/symbol-variant_pcs-1.d
Normal file
10
gas/testsuite/gas/aarch64/symbol-variant_pcs-1.d
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#objdump: -t
|
||||||
|
|
||||||
|
.*: file format .*
|
||||||
|
|
||||||
|
SYMBOL TABLE:
|
||||||
|
0+ l d \.text 0+ \.text
|
||||||
|
0+ l d \.data 0+ \.data
|
||||||
|
0+ l d \.bss 0+ \.bss
|
||||||
|
0+ l \.text 0+ func
|
||||||
|
0+ \*UND\* 0+ 0x80 foobar
|
8
gas/testsuite/gas/aarch64/symbol-variant_pcs-1.s
Normal file
8
gas/testsuite/gas/aarch64/symbol-variant_pcs-1.s
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
.text
|
||||||
|
.variant_pcs foobar
|
||||||
|
func:
|
||||||
|
bl foobar
|
||||||
|
b foobar
|
||||||
|
|
||||||
|
.data
|
||||||
|
.xword foobar
|
9
gas/testsuite/gas/aarch64/symbol-variant_pcs-2.d
Normal file
9
gas/testsuite/gas/aarch64/symbol-variant_pcs-2.d
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#objdump: -t
|
||||||
|
|
||||||
|
.*: file format .*
|
||||||
|
|
||||||
|
SYMBOL TABLE:
|
||||||
|
0+ l d \.text 0+ \.text
|
||||||
|
0+ l d \.data 0+ \.data
|
||||||
|
0+ l d \.bss 0+ \.bss
|
||||||
|
0+ l \.text 0+ 0x80 foo
|
4
gas/testsuite/gas/aarch64/symbol-variant_pcs-2.s
Normal file
4
gas/testsuite/gas/aarch64/symbol-variant_pcs-2.s
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
.text
|
||||||
|
.variant_pcs foo
|
||||||
|
foo:
|
||||||
|
ret
|
Reference in New Issue
Block a user