[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Tinycc-devel] [PATCH] tccelf.c: Fix the Linux-i386 build
From: |
Ramsay Jones |
Subject: |
[Tinycc-devel] [PATCH] tccelf.c: Fix the Linux-i386 build |
Date: |
Sun, 02 Feb 2014 11:29:08 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 |
Signed-off-by: Ramsay Jones <address@hidden>
---
Hi Thomas,
tcc currently fails to compile on Linux-i386; this patch fixes it
up for me. Unfortunately, the tests are also failing, but I don't
have time to look into fixing them. The failure looks like so:
------------ test3 ------------
../tcc -B.. -I.. -I.. -I../include -DCONFIG_LDDIR="\"lib\""
-DCONFIG_MULTIARCHDIR="\"i386-linux-gnu\"" -DTCC_TARGET_I386 -DONE_SOURCE -run
../tcc.c -B.. -I.. -I.. -I../include -DCONFIG_LDDIR="\"lib\""
-DCONFIG_MULTIARCHDIR="\"i386-linux-gnu\"" -DTCC_TARGET_I386 -DONE_SOURCE -run
../tcc.c -B.. -I.. -I.. -I../include -DCONFIG_LDDIR="\"lib\""
-DCONFIG_MULTIARCHDIR="\"i386-linux-gnu\"" -DTCC_TARGET_I386 -DONE_SOURCE -run
../tcc.c -B.. -I.. -I.. -I../include -run tcctest.c > test.out3
--- test.ref 2014-02-02 11:17:41.049081012 +0000
+++ test.out3 2014-02-02 11:17:41.601083749 +0000
@@ -346,7 +346,7 @@
itof: -1234.000000
lltof: -2334.000000
utof: 2166572288.000000
-ulltof: 18446744073709551616.000000
+ulltof: 2334.000000
float: 42.12346
double: 42.123455
long double: 42.123455
@@ -385,7 +385,7 @@
itof: -1234.000000
lltof: -2334.000000
utof: 2166572288.000000
-ulltof: 18446744073709549568.000000
+ulltof: 2334.000000
float: 42.12346
double: 42.123457
long double: 42.123457
@@ -424,7 +424,7 @@
itof: -1234.000000
lltof: -2334.000000
utof: 2166572288.000000
-ulltof: 18446744073709549282.000000
+ulltof: 2334.000000
float: 42.12346
double: 42.123457
long double: 42.123457
make[1]: *** [test3] Error 1
make[1]: Leaving directory `/home/ramsay/tinycc/tests'
make: *** [test] Error 2
$
HTH
ATB,
Ramsay Jones
tccelf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tccelf.c b/tccelf.c
index e5fcfb0..9890829 100644
--- a/tccelf.c
+++ b/tccelf.c
@@ -511,7 +511,7 @@ static addr_t add_jmp_table(TCCState *s1, int val)
ST_FUNC void relocate_section(TCCState *s1, Section *s)
{
Section *sr;
- ElfW_Rel *rel;
+ ElfW_Rel *rel, *qrel;
ElfW(Sym) *sym;
int type, sym_index;
unsigned char *ptr;
@@ -521,6 +521,7 @@ ST_FUNC void relocate_section(TCCState *s1, Section *s)
#endif
sr = s->reloc;
+ qrel = (ElfW_Rel *)sr->data;
for_each_elem(sr, 0, rel, ElfW_Rel) {
ptr = s->data + rel->r_offset;
--
1.8.5
- [Tinycc-devel] [PATCH] tccelf.c: Fix the Linux-i386 build,
Ramsay Jones <=