mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-27 06:10:06 +08:00
use new weaken_symbol() to fix another real-world corner case
This commit is contained in:
parent
8bcb2ae1b2
commit
4fbe3cda33
2
tccgen.c
2
tccgen.c
@ -5600,7 +5600,7 @@ ST_FUNC void decl(int l)
|
|||||||
sym = external_sym(v, &type, r, asm_label);
|
sym = external_sym(v, &type, r, asm_label);
|
||||||
|
|
||||||
if (type.t & VT_WEAK)
|
if (type.t & VT_WEAK)
|
||||||
sym->type.t |= VT_WEAK;
|
weaken_symbol(sym);
|
||||||
|
|
||||||
if (ad.alias_target) {
|
if (ad.alias_target) {
|
||||||
Section tsec;
|
Section tsec;
|
||||||
|
@ -2374,6 +2374,9 @@ int some_lib_func(void);
|
|||||||
int dummy_impl_of_slf(void) { return 444; }
|
int dummy_impl_of_slf(void) { return 444; }
|
||||||
int some_lib_func(void) __attribute__((weak, alias("dummy_impl_of_slf")));
|
int some_lib_func(void) __attribute__((weak, alias("dummy_impl_of_slf")));
|
||||||
|
|
||||||
|
int weak_toolate() { return 0; }
|
||||||
|
int weak_toolate() __attribute__((weak));
|
||||||
|
|
||||||
void __attribute__((weak)) weak_test(void)
|
void __attribute__((weak)) weak_test(void)
|
||||||
{
|
{
|
||||||
printf("weak_f1=%d\n", weak_f1 ? weak_f1() : 123);
|
printf("weak_f1=%d\n", weak_f1 ? weak_f1() : 123);
|
||||||
|
Loading…
Reference in New Issue
Block a user