tccasm: make VT_VOID symbols ST_NOTYPE, elf-wise
This was confusing objdump such that it did not print disassembly with -d. Also, put filename as with C compilation
This commit is contained in:
2
libtcc.c
2
libtcc.c
@ -780,6 +780,8 @@ static void put_extern_sym2(Sym *sym, Section *section,
|
|||||||
if (FUNC_CALL(attr) == FUNC_STDCALL)
|
if (FUNC_CALL(attr) == FUNC_STDCALL)
|
||||||
other |= 2;
|
other |= 2;
|
||||||
#endif
|
#endif
|
||||||
|
} else if ((sym->type.t & VT_BTYPE) == VT_VOID) {
|
||||||
|
sym_type = STT_NOTYPE;
|
||||||
} else {
|
} else {
|
||||||
sym_type = STT_OBJECT;
|
sym_type = STT_OBJECT;
|
||||||
}
|
}
|
||||||
|
|||||||
6
tccasm.c
6
tccasm.c
@ -712,6 +712,12 @@ static int tcc_assemble(TCCState *s1, int do_preprocess)
|
|||||||
|
|
||||||
define_start = define_stack;
|
define_start = define_stack;
|
||||||
|
|
||||||
|
/* an elf symbol of type STT_FILE must be put so that STB_LOCAL
|
||||||
|
symbols can be safely used */
|
||||||
|
put_elf_sym(symtab_section, 0, 0,
|
||||||
|
ELFW(ST_INFO)(STB_LOCAL, STT_FILE), 0,
|
||||||
|
SHN_ABS, file->filename);
|
||||||
|
|
||||||
ret = tcc_assemble_internal(s1, do_preprocess);
|
ret = tcc_assemble_internal(s1, do_preprocess);
|
||||||
|
|
||||||
cur_text_section->data_offset = ind;
|
cur_text_section->data_offset = ind;
|
||||||
|
|||||||
Reference in New Issue
Block a user