From d241d4f77a07cdb2117fb3ace8499ae2b78a097d Mon Sep 17 00:00:00 2001 From: Lephenixnoir Date: Thu, 20 May 2021 21:27:38 +0200 Subject: [PATCH] fix aliases not using underscore prefixes in assembler code long double functions, that are identical to double functions, usually define themselves as weak references to their double counterpart. However, the piece of assembler written for that produces .equ l, but on SuperH C-exported symbols have leading underscores. This commit adds an SH3 exception to use instead .equ _l, _ which fixes a number of long double functions. --- src/cdefs-compat.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/cdefs-compat.h b/src/cdefs-compat.h index c7deeb1..ead7589 100644 --- a/src/cdefs-compat.h +++ b/src/cdefs-compat.h @@ -34,9 +34,15 @@ #else #ifdef __ELF__ #ifdef __STDC__ +#if defined(__sh3__) +#define openlibm_weak_reference(sym,alias) \ + __asm__(".weak _" #alias); \ + __asm__(".equ _" #alias ", _" #sym) +#else #define openlibm_weak_reference(sym,alias) \ __asm__(".weak " #alias); \ __asm__(".equ " #alias ", " #sym) +#endif /* __sh3__ */ #ifdef __warn_references #define openlibm_warn_references(sym,msg) __warn_references(sym,msg) #else