-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use a shared header file to deduplicate some directives * Guarantee hidden visibility for functions * Enable gc-sections on macOS x86_64 * Add `.type` annotations for ARM
- Loading branch information
1 parent
013d0c1
commit 67d34f5
Showing
5 changed files
with
77 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#ifndef __wasmtime_common_h | ||
#define __wasmtime_common_h | ||
|
||
#if CFG_TARGET_OS_macos | ||
|
||
.section __TEXT,__text,regular,pure_instructions | ||
|
||
#define GLOBL(fnname) .globl _##fnname | ||
#define HIDDEN(fnname) .private_extern _##fnname | ||
#define TYPE(fnname) | ||
#define FUNCTION(fnname) _##fnname | ||
#define SIZE(fnname) | ||
|
||
// Tells the linker it's safe to gc symbols away if not used. | ||
#define FOOTER .subsections_via_symbols | ||
|
||
#else | ||
|
||
.text | ||
|
||
#define GLOBL(fnname) .globl fnname | ||
#define HIDDEN(fnname) .hidden fnname | ||
#ifdef CFG_TARGET_ARCH_arm | ||
#define TYPE(fnname) .type fnname,%function | ||
#else | ||
#define TYPE(fnname) .type fnname,@function | ||
#endif | ||
#define FUNCTION(fnname) fnname | ||
#define SIZE(fnname) .size fnname,.-fnname | ||
|
||
// Mark that we don't need executable stack. | ||
#define FOOTER .section .note.GNU-stack,"",%progbits | ||
|
||
#endif | ||
|
||
#endif // __wasmtime_common_h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters