tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] linux/unix shared libraries?


From: Olaf Dietrich
Subject: Re: [Tinycc-devel] linux/unix shared libraries?
Date: Mon, 28 Apr 2008 09:08:44 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

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) ||




reply via email to

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