Allow to get sym attr and fail if no entry
Change alloc_sym_attr into get_sym_attr and add a parameter to control whether to allocate a new symattr structure or return NULL if symbol is not found;
This commit is contained in:
6
tcc.h
6
tcc.h
@ -570,6 +570,7 @@ typedef struct ASMOperand {
|
||||
} ASMOperand;
|
||||
#endif
|
||||
|
||||
/* extra symbol attributes (not in symbol table) */
|
||||
struct sym_attr {
|
||||
unsigned long got_offset;
|
||||
unsigned long plt_offset;
|
||||
@ -708,8 +709,6 @@ struct TCCState {
|
||||
/* got & plt handling */
|
||||
Section *got;
|
||||
Section *plt;
|
||||
struct sym_attr *sym_attrs;
|
||||
int nb_sym_attrs;
|
||||
/* give the correspondance from symtab indexes to dynsym indexes */
|
||||
int *symtab_to_dynsym;
|
||||
|
||||
@ -719,6 +718,9 @@ struct TCCState {
|
||||
Section *dynsym;
|
||||
/* copy of the gobal symtab_section variable */
|
||||
Section *symtab;
|
||||
/* extra attributes (eg. GOT/PLT value) for symtab symbols */
|
||||
struct sym_attr *sym_attrs;
|
||||
int nb_sym_attrs;
|
||||
/* tiny assembler state */
|
||||
Sym *asm_labels;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user