gas: Restore tc_pe_dwarf2_emit_offset for pe-aarch64
authorMark Harmstone <mark@harmstone.com>
Tue, 27 Dec 2022 22:16:04 +0000 (22:16 +0000)
committerMark Harmstone <mark@harmstone.com>
Tue, 10 Jan 2023 23:30:52 +0000 (23:30 +0000)
Restores tc_pe_dwarf2_emit_offset in tc-aarch64.c, which is needed to
make sure that DWARF offsets are encoded correctly (they're secrels in
COFF). There were remnants of this there before, but they were removed
by Jedidiah's original patch - presumably because we didn't yet have
.secrel32.

gas/config/tc-aarch64.c
gas/config/tc-aarch64.h

index ad070cd06182944f04c55867956e6810933adba2..2b74db256a253634893f9314cc692e92b348081a 100644 (file)
@@ -2116,6 +2116,17 @@ s_secrel (int dummy ATTRIBUTE_UNUSED)
   input_line_pointer--;
   demand_empty_rest_of_line ();
 }
+
+void
+tc_pe_dwarf2_emit_offset (symbolS *symbol, unsigned int size)
+{
+  expressionS exp;
+
+  exp.X_op = O_secrel;
+  exp.X_add_symbol = symbol;
+  exp.X_add_number = 0;
+  emit_expr (&exp, size);
+}
 #endif /* TE_PE */
 
 static void s_aarch64_arch (int);
index fa4b3ac577e64996248f7825a917a26504552ac9..134c1f87b4fbe029ae1a8d748e8bd4068eb51298 100644 (file)
@@ -315,7 +315,12 @@ extern int tc_aarch64_regname_to_dw2regnum (char *regname);
 extern void tc_aarch64_frame_initial_instructions (void);
 
 #ifdef TE_PE
+
 #define O_secrel O_md1
+
+#define TC_DWARF2_EMIT_OFFSET  tc_pe_dwarf2_emit_offset
+void tc_pe_dwarf2_emit_offset (symbolS *, unsigned int);
+
 #endif /* TE_PE */
 
 #endif /* TC_AARCH64 */