[SeaBIOS] [PATCH v4 1/4] romlayout.S: Add missing SHF_ALLOC flag to .fixedaddr.\addr

Fangrui Song via SeaBIOS posted 4 patches 1 year, 10 months ago
[SeaBIOS] [PATCH v4 1/4] romlayout.S: Add missing SHF_ALLOC flag to .fixedaddr.\addr
Posted by Fangrui Song via SeaBIOS 1 year, 10 months ago
It does not make sense to reference a SHF_ALLOC section from a
non-SHF_ALLOC section via R_386_PC16. Conceptually, even if a
non-SHF_ALLOC is loaded as part of the memory image, the distance
between it and a SHF_ALLOC section may not be a constant, so the linker
cannot reasonably resolve the relocation.

GNU ld allows it but lld will warn. Add the SHF_ALLOC flag.

Signed-off-by: Fangrui Song <maskray@google.com>
---
 src/romlayout.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/romlayout.S b/src/romlayout.S
index c4a4635..a854783 100644
--- a/src/romlayout.S
+++ b/src/romlayout.S
@@ -587,7 +587,7 @@ entry_18:
 
         // Specify a location in the fixed part of bios area.
         .macro ORG addr
-        .section .fixedaddr.\addr
+        .section .fixedaddr.\addr,"a"
         .endm
 
         ORG 0xe05b
-- 
2.37.0.144.g8ac04bfd2-goog

_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org