weak redefinition of a symbol should weaken the original
This commit is contained in:
3
tccgen.c
3
tccgen.c
@ -5592,6 +5592,9 @@ ST_FUNC void decl(int l)
|
|||||||
extern */
|
extern */
|
||||||
sym = external_sym(v, &type, r, asm_label);
|
sym = external_sym(v, &type, r, asm_label);
|
||||||
|
|
||||||
|
if (type.t & VT_WEAK)
|
||||||
|
sym->type.t |= VT_WEAK;
|
||||||
|
|
||||||
if (ad.alias_target) {
|
if (ad.alias_target) {
|
||||||
Section tsec;
|
Section tsec;
|
||||||
Elf32_Sym *esym;
|
Elf32_Sym *esym;
|
||||||
|
|||||||
@ -2370,6 +2370,10 @@ extern __typeof(dummy) weak_dummy1 __attribute__((weak, alias("dummy")));
|
|||||||
static const size_t dummy = 0;
|
static const size_t dummy = 0;
|
||||||
extern __typeof(dummy) weak_dummy1 __attribute__((weak, alias("dummy")));
|
extern __typeof(dummy) weak_dummy1 __attribute__((weak, alias("dummy")));
|
||||||
extern __typeof(dummy) __attribute__((weak, alias("dummy"))) weak_dummy2;
|
extern __typeof(dummy) __attribute__((weak, alias("dummy"))) weak_dummy2;
|
||||||
|
extern __attribute__((weak, alias("dummy"))) __typeof(dummy) weak_dummy3;
|
||||||
|
|
||||||
|
int some_lib_func(void);
|
||||||
|
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")));
|
||||||
|
|
||||||
void __attribute__((weak)) weak_test(void)
|
void __attribute__((weak)) weak_test(void)
|
||||||
|
|||||||
Reference in New Issue
Block a user