Skip to content

Commit

Permalink
Silence ld warning with libasmrun.so
Browse files Browse the repository at this point in the history
Three backends were missing .type and .size directives on
caml_system.frametable which causes a warning from ld when linking
against the shared runtime.
  • Loading branch information
dra27 committed Sep 24, 2024
1 parent 74a1509 commit 289f29a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions runtime/amd64.S
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions runtime/power.S
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down

0 comments on commit 289f29a

Please sign in to comment.