tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] ARM GOT initialization problem


From: David Given
Subject: [Tinycc-devel] ARM GOT initialization problem
Date: Thu, 17 Apr 2008 00:29:49 +0100
User-agent: Thunderbird 2.0.0.12 (X11/20080213)

I'm trying to use tcc as an ELF module loader on a platform that doesn't
normally have one. (This works pretty well, BTW.) I'm loading .o files
built with gcc, adding some dynamically generated glue compiled
on-the-fly with libtcc, and then running it.

However, whenever the gcc-generated code tries to do stuff with global
variables, it behaves really weirdly and crashes. Unfortunately I don't
have a debugger so investigation involves lots of printf statements, but
it appears that the globals aren't being initialised correctly.

Searching the mailing list reveals this thread from 2006:

http://lists.gnu.org/archive/html/tinycc-devel/2006-12/msg00018.html

(Summary: tcc allocates space for the GOT but doesn't initialise it.)

Does anyone know if this ever got fixed?

Assuming that it hasn't, then as a workaround, is it possible to
persuade gcc *not* to route globals via the GOT but to instead to just
generate old-fashioned absolute references via a constant pool instead?
If so, does anyone know how? Doing web searches for 'got' is
surprisingly hard...

-- 
David Given
address@hidden


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]