tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] some symbole are defined twice when we call tcc_reloc


From: grischka
Subject: Re: [Tinycc-devel] some symbole are defined twice when we call tcc_relocate twice
Date: Sun, 29 Jan 2017 12:53:46 +0100
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

uso ewin wrote:
When I've try to call successively tcc_compile_string, tcc_relocate,
tcc_compile_string, tcc_relocate

Simply, such usage currently is not part of the concept.  As it
is, tcc_relocate must be called only once for each TCCState.

I don't see right now why you would want that.

In principle it could be enabled, but there are some complications.
For example symbols need to be converted to SHN_ABS, old code needs
to be deleted, ...

-- grischka

tcc give me these errors:

tcc: error: '_etext' defined twice
tcc: error: '_edata' defined twice
tcc: error: '__preinit_array_start' defined twice
tcc: error: '__preinit_array_end' defined twice
tcc: error: '__init_array_start' defined twice
tcc: error: '__init_array_end' defined twice
tcc: error: '__fini_array_start' defined twice
tcc: error: '__fini_array_end' defined twice

I guess tcc try to add some libraries at the begin of our "object"
during the reallocation,
but if we call tcc_relocate twice, then tcc try to add these libraries
twice, which make some
symbols define twice.


I've made a patch to fix it for me:
https://github.com/cosmo-ray/tcc/commit/36266c0e619cc1e425c4fad4337f1877148f58bc

As it's the first time I touch to tcc code, and touch a compiler code
I'm not sure I didn't break anything, does this patch look good to you ?
Should I push it directly to mob ?

_______________________________________________
Tinycc-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/tinycc-devel




reply via email to

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