aboutsummaryrefslogtreecommitdiff
path: root/tcc.h
diff options
context:
space:
mode:
authorThomas Preud'homme <robotux@celest.fr>2016-11-12 23:16:07 +0800
committerThomas Preud'homme <robotux@celest.fr>2016-12-03 17:26:51 +0000
commit2c38800bbe0544830863247a23594e37c531be8d (patch)
tree100cb2b7e4e6ac44c7aedc4ce5091238b183414c /tcc.h
parenta11b0a67e368f86751431f827db3ca85682b9864 (diff)
downloadtinycc-2c38800bbe0544830863247a23594e37c531be8d.tar.gz
tinycc-2c38800bbe0544830863247a23594e37c531be8d.tar.bz2
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;
Diffstat (limited to 'tcc.h')
-rw-r--r--tcc.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/tcc.h b/tcc.h
index f0cad40..3010bb9 100644
--- a/tcc.h
+++ b/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;