diff options
| author | Thomas Preud'homme <robotux@celest.fr> | 2016-12-05 20:40:59 +0000 |
|---|---|---|
| committer | Thomas Preud'homme <robotux@celest.fr> | 2016-12-05 20:51:10 +0000 |
| commit | 59391d5520534ef1fe3cc2e96fa567c870e2f533 (patch) | |
| tree | b1382b41c1a41310db148c9939f1792b621332d9 /tcc.h | |
| parent | 097cf3aa5ee370bab50d6d15cef9b0af55a1a3a2 (diff) | |
| download | tinycc-59391d5520534ef1fe3cc2e96fa567c870e2f533.tar.gz tinycc-59391d5520534ef1fe3cc2e96fa567c870e2f533.tar.bz2 | |
Fix relocs_info declaration in tcc.h
C standard specifies that array should be declared with a non null size
or with * for standard array. Declaration of relocs_info in tcc.h was
not respecting this rule. This commit add a R_NUM macro that maps to the
R_<ARCH>_NUM macros and declare relocs_info using it. This commit also
moves all linker-related macros from <arch>-gen.c files to <arch>-link.c
ones.
Diffstat (limited to 'tcc.h')
| -rw-r--r-- | tcc.h | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -290,19 +290,24 @@ #define TARGET_DEFS_ONLY #ifdef TCC_TARGET_I386 # include "i386-gen.c" +# include "i386-link.c" #endif #ifdef TCC_TARGET_X86_64 # include "x86_64-gen.c" +# include "x86_64-link.c" #endif #ifdef TCC_TARGET_ARM # include "arm-gen.c" +# include "arm-link.c" #endif #ifdef TCC_TARGET_ARM64 # include "arm64-gen.c" +# include "arm64-link.c" #endif #ifdef TCC_TARGET_C67 # include "coff.h" # include "c67-gen.c" +# include "c67-link.c" #endif #undef TARGET_DEFS_ONLY @@ -1325,7 +1330,7 @@ struct reloc_info { #define INIT_RELOC_INFO(rtype, code_reloc, gotplt_entry, pltoff_addend) \ [rtype] = {code_reloc, gotplt_entry, pltoff_addend}, -ST_DATA struct reloc_info relocs_info[]; +ST_DATA struct reloc_info relocs_info[R_NUM]; ST_DATA Section *text_section, *data_section, *bss_section; /* predefined sections */ ST_DATA Section *cur_text_section; /* current section where function code is generated */ |
