From c249495e2df2c695fe8f97a17cdd5de0a02aa501 Mon Sep 17 00:00:00 2001 From: Pierre Muller Date: Mon, 17 Jul 2023 10:50:29 +0200 Subject: [PATCH] Add '%note' to .note.openbsd.ident section --- rtl/openbsd/i386/openbsd_ident.inc | 5 ++++- rtl/openbsd/i386/prt0.as | 2 +- rtl/openbsd/x86_64/openbsd_ident.inc | 5 ++++- rtl/openbsd/x86_64/prt0.as | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/rtl/openbsd/i386/openbsd_ident.inc b/rtl/openbsd/i386/openbsd_ident.inc index ff14d8c867..a000cd6c54 100644 --- a/rtl/openbsd/i386/openbsd_ident.inc +++ b/rtl/openbsd/i386/openbsd_ident.inc @@ -1,8 +1,11 @@ {$asmmode att} +{$if FPC_FULLVERSION>30300} + {$define USE_NOTE} +{$endif} procedure OpenBSDIdentTag;nostackframe;assembler; asm - .section ".note.openbsd.ident", "a" + .section ".note.openbsd.ident", "a"{$ifdef USE_NOTE}, @note {$endif} .p2align 2 .long 8 .long 4 diff --git a/rtl/openbsd/i386/prt0.as b/rtl/openbsd/i386/prt0.as index 16e652c1a9..d588aca82f 100644 --- a/rtl/openbsd/i386/prt0.as +++ b/rtl/openbsd/i386/prt0.as @@ -1,4 +1,4 @@ - .section ".note.openbsd.ident", "a" + .section ".note.openbsd.ident", "a", @note .p2align 2 .long 8 .long 4 diff --git a/rtl/openbsd/x86_64/openbsd_ident.inc b/rtl/openbsd/x86_64/openbsd_ident.inc index a6f203990d..6c46ab8466 100644 --- a/rtl/openbsd/x86_64/openbsd_ident.inc +++ b/rtl/openbsd/x86_64/openbsd_ident.inc @@ -1,8 +1,11 @@ {$asmmode gas} +{$if FPC_FULLVERSION>30300} + {$define USE_NOTE} +{$endif} procedure OpenBSDIdentTag;nostackframe;assembler; asm - .section ".note.openbsd.ident", "a" + .section ".note.openbsd.ident", "a"{$ifdef USE_NOTE}, @note {$endif} .p2align 2 .long 8 .long 4 diff --git a/rtl/openbsd/x86_64/prt0.as b/rtl/openbsd/x86_64/prt0.as index 8045c4b603..74b4a965db 100644 --- a/rtl/openbsd/x86_64/prt0.as +++ b/rtl/openbsd/x86_64/prt0.as @@ -1,4 +1,4 @@ - .section ".note.openbsd.ident", "a" + .section ".note.openbsd.ident", "a", @note .p2align 2 .long 8 .long 4