aboutsummaryrefslogtreecommitdiff
path: root/tcc.h
diff options
context:
space:
mode:
authormob <mob>2012-02-26 19:02:51 -0600
committermob <mob>2012-02-26 19:02:51 -0600
commitd7a7c3769d0a1dcb8400258cd8adf78a8566de61 (patch)
tree1333ad336c0626f41ec5690ea9e34c908c967d60 /tcc.h
parent6e13c35334200e7ef918308aeb820404d7b35283 (diff)
downloadtinycc-d7a7c3769d0a1dcb8400258cd8adf78a8566de61.tar.gz
tinycc-d7a7c3769d0a1dcb8400258cd8adf78a8566de61.tar.bz2
Multiple fixes for 64 bit sections
This changeset attempts to fix a few problems when giving using the high 32bits of a 64bit section offset. There are likely more issues (or perhaps regressions) lurking in the muck here. In general, this moves a few data type declarations to use uplong. Also, add support for 64bit mingw32 building under cygwin. Because native types are used for 64 bit offsets, this won't fix challenges with cross compiling from 32bit -> 64bit. Tested under cygwin, against binary compiled with -Wl,-Ttext=0xffffff8000000000 Signed-off-by: Andrew Mulbrook <andrew262@gmail.com>
Diffstat (limited to 'tcc.h')
-rw-r--r--tcc.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/tcc.h b/tcc.h
index d158829..18a6b91 100644
--- a/tcc.h
+++ b/tcc.h
@@ -313,8 +313,8 @@ typedef struct Section {
int sh_addralign; /* elf section alignment */
int sh_entsize; /* elf entry size */
unsigned long sh_size; /* section size (only used during output) */
- unsigned long sh_addr; /* address at which the section is relocated */
- unsigned long sh_offset; /* file offset */
+ uplong sh_addr; /* address at which the section is relocated */
+ unsigned long sh_offset; /* file offset */
int nb_hashed_syms; /* used to resize the hash table */
struct Section *link; /* link to another section */
struct Section *reloc; /* corresponding section for relocation, if any */
@@ -531,7 +531,7 @@ struct TCCState {
int alacarte_link;
/* address of text section */
- unsigned long text_addr;
+ uplong text_addr;
int has_text_addr;
/* symbols to call at load-time / unload-time */
@@ -872,6 +872,7 @@ enum tcc_token {
#define strtold (long double)strtod
#define strtof (float)strtod
#define strtoll (long long)strtol
+ #define strtoull (unsigned long long)strtoull
#endif
#else
/* XXX: need to define this to use them in non ISOC99 context */
@@ -992,8 +993,8 @@ ST_FUNC void *section_ptr_add(Section *sec, unsigned long size);
ST_FUNC void section_reserve(Section *sec, unsigned long size);
ST_FUNC Section *find_section(TCCState *s1, const char *name);
-ST_FUNC void put_extern_sym2(Sym *sym, Section *section, unsigned long value, unsigned long size, int can_add_underscore);
-ST_FUNC void put_extern_sym(Sym *sym, Section *section, unsigned long value, unsigned long size);
+ST_FUNC void put_extern_sym2(Sym *sym, Section *section, uplong value, unsigned long size, int can_add_underscore);
+ST_FUNC void put_extern_sym(Sym *sym, Section *section, uplong value, unsigned long size);
ST_FUNC void greloc(Section *s, Sym *sym, unsigned long offset, int type);
ST_INLN void sym_free(Sym *sym);