aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorMark Harmstone <mark@harmstone.com>2023-01-23 00:26:07 +0000
committerMark Harmstone <mark@harmstone.com>2023-01-23 20:07:30 +0000
commit6f4a117fe1ea8f5722ff9fd4db9a1ecc8bd26b84 (patch)
tree78fcfec080ae889c1550dc039b372c2ae568b7b7 /gas
parent29e09a42f1d1af3d97652e54b6b3cac68cf61d15 (diff)
downloadgdb-6f4a117fe1ea8f5722ff9fd4db9a1ecc8bd26b84.zip
gdb-6f4a117fe1ea8f5722ff9fd4db9a1ecc8bd26b84.tar.gz
gdb-6f4a117fe1ea8f5722ff9fd4db9a1ecc8bd26b84.tar.bz2
Add support for secidx relocations to aarch64-w64-mingw32
This patch adds support for the .secidx directive and its corresponding relocation to aarch64-w64-mingw32. As with x86, this is a two-byte LE integer which gets filled in with the 1-based index of the output section that a symbol ends up in. This is needed for PDBs, which represent addresses as a .secrel32, .secidx pair. The test is substantially the same as for amd64, but with changes made for padding and alignment.
Diffstat (limited to 'gas')
-rw-r--r--gas/config/tc-aarch64.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
index 2b74db2..2aeab6f 100644
--- a/gas/config/tc-aarch64.c
+++ b/gas/config/tc-aarch64.c
@@ -2127,6 +2127,25 @@ tc_pe_dwarf2_emit_offset (symbolS *symbol, unsigned int size)
exp.X_add_number = 0;
emit_expr (&exp, size);
}
+
+static void
+s_secidx (int dummy ATTRIBUTE_UNUSED)
+{
+ expressionS exp;
+
+ do
+ {
+ expression (&exp);
+ if (exp.X_op == O_symbol)
+ exp.X_op = O_secidx;
+
+ emit_expr (&exp, 2);
+ }
+ while (*input_line_pointer++ == ',');
+
+ input_line_pointer--;
+ demand_empty_rest_of_line ();
+}
#endif /* TE_PE */
static void s_aarch64_arch (int);
@@ -2166,6 +2185,7 @@ const pseudo_typeS md_pseudo_table[] = {
#endif
#ifdef TE_PE
{"secrel32", s_secrel, 0},
+ {"secidx", s_secidx, 0},
#endif
{"float16", float_cons, 'h'},
{"bfloat16", float_cons, 'b'},
@@ -9304,6 +9324,7 @@ md_apply_fix (fixS * fixP, valueT * valP, segT seg)
case BFD_RELOC_RVA:
case BFD_RELOC_32_SECREL:
+ case BFD_RELOC_16_SECIDX:
break;
default:
@@ -9395,6 +9416,11 @@ cons_fix_new_aarch64 (fragS * frag, int where, int size, expressionS * exp)
exp->X_op = O_symbol;
type = BFD_RELOC_32_SECREL;
}
+ else if (exp->X_op == O_secidx)
+ {
+ exp->X_op = O_symbol;
+ type = BFD_RELOC_16_SECIDX;
+ }
else
{
#endif