tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] tcc as compiler for tccboot


From: David Mertens
Subject: Re: [Tinycc-devel] tcc as compiler for tccboot
Date: Wed, 20 Apr 2016 21:34:10 -0400

Hello Sergey,

That's a good bit of sleuthing. A couple of questions immediately come to mind:

Thanks!

David


On Wed, Apr 20, 2016 at 11:49 AM, Sergey Korshunoff <address@hidden> wrote:
> Just checked. I used a hex editor to replace a 0x20 bytes in mem-2.o with 0x04.
> This helped.

diff --git a/libtcc.c b/libtcc.c
index 5aebd32..a8e109c 100644
--- a/libtcc.c
+++ b/libtcc.c
@@ -514,7 +514,11 @@ ST_FUNC Section *new_section(TCCState *s1, const
char *name, int sh_type, int sh
         sec->sh_addralign = 1;
         break;
     default:
+        #ifdef TCC_TARGET_I386
+        sec->sh_addralign =  4; /* gcc/pcc default alignment for i386 */
+        #else
         sec->sh_addralign = 32; /* default conservative alignment */
+        #endif
         break;
     }

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



--
 "Debugging is twice as hard as writing the code in the first place.
  Therefore, if you write the code as cleverly as possible, you are,
  by definition, not smart enough to debug it." -- Brian Kernighan

reply via email to

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