[Tinycc-devel] Strange issue with 64bit section offsets
From:
Andrew Mulbrook
Subject:
[Tinycc-devel] Strange issue with 64bit section offsets
Date:
Sat, 25 Feb 2012 00:24:42 -0600
Greetings,
I'm using tcc to develop a "toy" operating system kernel. In adding 64bit support, I discovered what appears to be a bug in tcc.
Several fields in "tcc.h" structures are defined as "unsigned long". In a MingW32 environmebr, these appear to break when generating a text section with a high load offset. I'm using "-Wl,-Ttext=0xffffff8000000000". Also, the link_option parsing inside libtcc.c uses "strtol" as opposed to "strtoll". On 64 bit linux, the binary image works as expected. On 64bit windows, the long only holds a 32bit offset and things go 'splody.
This appears on first glance to be fixable via changing the "long" references in the structure to long long /int64 types. However, before I start venturing into the maze of writing a bugfix, I was curious if anyone was looking at / developing the 64bit portions of tcc, or if submitted patches would even be seen by someone. Was this a known issue with larger implications? I also noticed objdump is currently choking on the resulting binary as well (linux 64bit testing).
I noticed the tinycc website says this compiler isn't being actively maintained, but there is a steady (extremely light) stream of commits. Has someone taken over this project? tcc has the nice benefit for me of running on windows & linux without huge headaches in bringing up a proper cross toolchain.