grischka (2008-04-25T19:18:10+0200):
>
> Instead it looks like if it generates bogus relocations for sections
> with zero size.
Thanks! With the new versions of tccelf.c (and tcc.c) from
the CVS, building of shared libs works perfectly! I was also
able to compile a larger (Tcl-based) project for which I
build Tcl extensions (= shared libraries).
Olaf
> This patch fixes it for me:
>
> diff --git a/tccelf.c b/tccelf.c
> index 730643d..e17f2df 100644
> --- a/tccelf.c
> +++ b/tccelf.c
> @@ -1372,7 +1372,9 @@ int tcc_output_file(TCCState *s1, const char *filename)
> if (file_type == TCC_OUTPUT_DLL &&
> s->sh_type == SHT_REL &&
> !(s->sh_flags & SHF_ALLOC)) {
> - prepare_dynamic_rel(s1, s);
> + /* //gr: avoid bogus relocs for empty (debug) sections */
> + if (s1->sections[s->sh_info]->sh_flags & SHF_ALLOC)
> + prepare_dynamic_rel(s1, s);
> } else if (do_debug ||
> file_type == TCC_OUTPUT_OBJ ||
> (s->sh_flags & SHF_ALLOC) ||
_______________________________________________
Tinycc-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/tinycc-devel