aboutsummaryrefslogtreecommitdiff
path: root/tcc.h
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2017-03-12 05:25:09 +0100
committerMichael Matz <matz@suse.de>2017-05-02 03:13:55 +0200
commitc7dbc900c8089ddff753ca2d618fb313b357d927 (patch)
tree81496586280f07286c3c79e7c4a4a74ebb7dc39f /tcc.h
parent25522e4799d1bcfd04de521d1e14b725c69f2f41 (diff)
downloadtinycc-c7dbc900c8089ddff753ca2d618fb313b357d927.tar.gz
tinycc-c7dbc900c8089ddff753ca2d618fb313b357d927.tar.bz2
Cleanups (float consts, sections, symbols)
introduce common_section (SHN_COMMON), factorize some handling in decl_initializer_alloc, add section_add and use it to factorize some code that allocates stuff in sections (at the same time also fixing harmless bugs re section alignment), use init_putv to emit float consts into .data from gv() (fixing an XXX).
Diffstat (limited to 'tcc.h')
-rw-r--r--tcc.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/tcc.h b/tcc.h
index 02619ba..45d62e6 100644
--- a/tcc.h
+++ b/tcc.h
@@ -470,7 +470,6 @@ typedef struct Sym {
/* special flag, too */
#define SECTION_ABS ((void *)1)
-#define SECTION_COMMON ((void *)2)
typedef struct Section {
unsigned long data_offset; /* current data offset */
@@ -1360,6 +1359,7 @@ typedef struct {
} Stab_Sym;
ST_DATA Section *text_section, *data_section, *bss_section; /* predefined sections */
+ST_DATA Section *common_section;
ST_DATA Section *cur_text_section; /* current section where function code is generated */
#ifdef CONFIG_TCC_ASM
ST_DATA Section *last_text_section; /* to handle .previous asm directive */
@@ -1381,6 +1381,7 @@ ST_FUNC void tccelf_stab_new(TCCState *s);
ST_FUNC Section *new_section(TCCState *s1, const char *name, int sh_type, int sh_flags);
ST_FUNC void section_realloc(Section *sec, unsigned long new_size);
+ST_FUNC size_t section_add(Section *sec, addr_t size, int align);
ST_FUNC void *section_ptr_add(Section *sec, addr_t size);
ST_FUNC void section_reserve(Section *sec, unsigned long size);
ST_FUNC Section *find_section(TCCState *s1, const char *name);