From 5df46cf1a0b6d3f3e3eb1fbdcaa0bb264867a57f Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Mon, 29 Aug 2022 17:29:47 +0100 Subject: [PATCH] Silence ld warning with libasmrun.so Three backends were missing .type and .size directives on caml_system.frametable which causes a warning from ld when linking against the shared runtime. --- Changes | 5 +++++ runtime/amd64.S | 5 +++++ runtime/power.S | 1 + 3 files changed, 11 insertions(+) diff --git a/Changes b/Changes index 14afa9832d5f..000ce4670c89 100644 --- a/Changes +++ b/Changes @@ -161,6 +161,11 @@ ___________ runtime assertions. (Antonin Décimo, review by Miod Vallat, Gabriel Scherer, and David Allsopp) +- #13???: Add missing .type and .size directives to main frametable to silence + warnings from the linker when using libasmrun_shared on i386, amd64 and power. + The other backends already carried these directives. + (David Allsopp, review by ???) + ### Code generation and optimizations: - #13014: Enable compile-time option -function-sections on all previously diff --git a/runtime/amd64.S b/runtime/amd64.S index c646f944df22..d74b63c0cc3e 100644 --- a/runtime/amd64.S +++ b/runtime/amd64.S @@ -77,8 +77,12 @@ #if defined(SYS_linux) || defined(SYS_gnu) #define ENDFUNCTION(name) \ .size name, . - name +#define ENDOBJECT(name) \ + .type name, @object; \ + .size name, . - name; #else #define ENDFUNCTION(name) +#define ENDOBJECT(name) #endif #include "../runtime/caml/asm.h" @@ -1331,6 +1335,7 @@ G(caml_system.frametable): .quad LBL(frame_runstack) /* return address into fiber_val_handler */ .value -1 /* negative frame size => use callback link */ .value 0 /* no roots here */ + ENDOBJECT(G(caml_system.frametable)) #if defined(SYS_macosx) .literal16 diff --git a/runtime/power.S b/runtime/power.S index 688e747cb992..bc7f68baabfa 100644 --- a/runtime/power.S +++ b/runtime/power.S @@ -1193,6 +1193,7 @@ caml_system.frametable: .short -1 /* negative frame size => use callback link */ .short 0 /* no roots here */ .align 3 + .size caml_system.frametable, .-caml_system.frametable /* TOC entries */