[7/7] gas: Restore tc_pe_dwarf2_emit_offset for pe-aarch64

Message ID 20230106012509.7918-7-mark@harmstone.com
State Accepted
Headers
Series [1/7] Fix size of external_reloc for pe-aarch64 |

Checks

Context Check Description
snail/binutils-gdb-check success Github commit url

Commit Message

Mark Harmstone Jan. 6, 2023, 1:25 a.m. UTC
  ---
 gas/config/tc-aarch64.c | 11 +++++++++++
 gas/config/tc-aarch64.h |  5 +++++
 2 files changed, 16 insertions(+)
  

Patch

diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
index ad070cd0618..2b74db256a2 100644
--- a/gas/config/tc-aarch64.c
+++ b/gas/config/tc-aarch64.c
@@ -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);
diff --git a/gas/config/tc-aarch64.h b/gas/config/tc-aarch64.h
index fa4b3ac577e..134c1f87b4f 100644
--- a/gas/config/tc-aarch64.h
+++ b/gas/config/tc-aarch64.h
@@ -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 */