From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7904) id D30B93858C2D; Tue, 10 Jan 2023 23:32:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D30B93858C2D Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Mark Harmstone To: bfd-cvs@sourceware.org Subject: [binutils-gdb] gas: Restore tc_pe_dwarf2_emit_offset for pe-aarch64 X-Act-Checkin: binutils-gdb X-Git-Author: Mark Harmstone X-Git-Refname: refs/heads/master X-Git-Oldrev: 16fea92ccd993fce6b5b0efebe059d542cad9932 X-Git-Newrev: 7697bc652347ec5009c2225d0abd3aff41477917 Message-Id: <20230110233256.D30B93858C2D@sourceware.org> Date: Tue, 10 Jan 2023 23:32:56 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2023 23:32:56 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D7697bc652347= ec5009c2225d0abd3aff41477917 commit 7697bc652347ec5009c2225d0abd3aff41477917 Author: Mark Harmstone Date: Tue Dec 27 22:16:04 2022 +0000 gas: Restore tc_pe_dwarf2_emit_offset for pe-aarch64 =20 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. Diff: --- gas/config/tc-aarch64.c | 11 +++++++++++ gas/config/tc-aarch64.h | 5 +++++ 2 files changed, 16 insertions(+) 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 =3D O_secrel; + exp.X_add_symbol =3D symbol; + exp.X_add_number =3D 0; + emit_expr (&exp, size); +} #endif /* TE_PE */ =20 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 *regn= ame); extern void tc_aarch64_frame_initial_instructions (void); =20 #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 */ =20 #endif /* TC_AARCH64 */