tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] Do not put static variables into a common section.


From: Simon 'corecode' Schubert
Subject: [Tinycc-devel] Do not put static variables into a common section.
Date: Mon, 27 Aug 2007 01:24:31 +0200
User-agent: Thunderbird 2.0.0.4 (X11/20070627)

This is at least needed for DragonFly, so perhaps also for *BSD.

Otherwise static variables won't get a proper offset when linking (with gnu ld).

--
Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \
# HG changeset patch
# User Simon 'corecode' Schubert <address@hidden>
# Date 1188155539 -7200
# Node ID a9fb98828aeb0423ca941a0f8604f6d968f5fc1a
# Parent  4c38950741702a6cc4f82920001d058a40887cd0
Do not put static variables into a common section.

diff -r 4c3895074170 -r a9fb98828aeb tcc.c
--- a/tcc.c     Sat Aug 18 01:13:00 2007 -0500
+++ b/tcc.c     Sun Aug 26 21:12:19 2007 +0200
@@ -8059,7 +8059,7 @@ static void decl_initializer_alloc(CType
         if (!sec) {
             if (has_init)
                 sec = data_section;
-            else if (tcc_state->nocommon)
+            else if ((type->t & VT_STATIC) || tcc_state->nocommon)
                 sec = bss_section;
         }
         if (sec) {

reply via email to

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