aboutsummaryrefslogtreecommitdiff
path: root/tccelf.c
diff options
context:
space:
mode:
authorseyko <seyko2@gmail.com>2015-03-23 19:24:55 +0300
committerseyko <seyko2@gmail.com>2015-03-23 19:24:55 +0300
commit8f6390061d4e839ad57d69ceb227e4f957b658de (patch)
tree461d3f731e0bc0f6f866823ab553edc2db86311a /tccelf.c
parent8dbe129ab78c2d43a9c69da795436cd7a4daf820 (diff)
downloadtinycc-8f6390061d4e839ad57d69ceb227e4f957b658de.tar.gz
tinycc-8f6390061d4e839ad57d69ceb227e4f957b658de.tar.bz2
fix for: x86_64-tcc compiled by i386-tcc is wrong
A test program (must be compiled by the above version of the tcc): /* Tickle a bug in TinyC on 64-bit systems: * the LSB of the top word or ARGP gets set * for no obvious reason. * * Source: a legacy language interpreter which * has a little stack / stack pointer for arguments. * * Output is: 0x8049620 0x10804961c * Should be: 0x8049620 0x804961c */ #include <stdio.h> #define NARGS 20000 int ARG[NARGS]; int *ARGSPACE = ARG; int *ARGP = ARG - 1; main() { printf("%p %p\n", ARGSPACE, ARGP); }
Diffstat (limited to 'tccelf.c')
-rw-r--r--tccelf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tccelf.c b/tccelf.c
index 26cdb59..5f526df 100644
--- a/tccelf.c
+++ b/tccelf.c
@@ -270,7 +270,7 @@ ST_FUNC int add_elf_sym(Section *s, addr_t value, unsigned long size,
/* put relocation */
ST_FUNC void put_elf_reloca(Section *symtab, Section *s, unsigned long offset,
- int type, int symbol, unsigned long addend)
+ int type, int symbol, addr_t addend)
{
char buf[256];
Section *sr;