git: 7d8cb4115996 - stable/13 - stand/efi: Fix for binutils when targeting arm64

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Mon, 15 Jul 2024 12:38:22 UTC
The branch stable/13 has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=7d8cb4115996cc46907f49c637a6599e0f14a2ed

commit 7d8cb4115996cc46907f49c637a6599e0f14a2ed
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2024-05-22 08:17:26 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2024-07-15 12:34:29 +0000

    stand/efi: Fix for binutils when targeting arm64
    
    When linking with ld.bfd it complain with the following:
    
    /usr/local/bin/aarch64-unknown-freebsd14.0-ld: start.o: relocation
     R_AARCH64_ABS32 against `__data_size' can not be used when making a
     shared object
    
    Fix this by marking the __data_size with ABSOLUTE. This returns a
    non-relocatable value which appears to be the same behaviour of lld.
    
    Reviewed by:    imp
    Sponsored by:   Arm Ltd
    Differential Revision:  https://reviews.freebsd.org/D45257
    
    (cherry picked from commit 9f44638ef2c46861565b89bb01bbeeab17755649)
---
 stand/efi/loader/arch/arm64/ldscript.arm64 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/stand/efi/loader/arch/arm64/ldscript.arm64 b/stand/efi/loader/arch/arm64/ldscript.arm64
index bacb81b5032f..c6af9f48bd12 100644
--- a/stand/efi/loader/arch/arm64/ldscript.arm64
+++ b/stand/efi/loader/arch/arm64/ldscript.arm64
@@ -79,7 +79,7 @@ SECTIONS
   . = ALIGN(16);
   .dynsym	: { *(.dynsym) }
   _edata = .;
-  __data_size = . - __data_start;
+  __data_size = ABSOLUTE(. - __data_start);
 
   /* Unused sections */
   .interp	: { *(.interp) }