From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16372 invoked by alias); 27 Nov 2009 02:18:18 -0000 Received: (qmail 16364 invoked by uid 22791); 27 Nov 2009 02:18:17 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-pw0-f57.google.com (HELO mail-pw0-f57.google.com) (209.85.160.57) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 27 Nov 2009 02:18:14 +0000 Received: by pwi2 with SMTP id 2so792590pwi.16 for ; Thu, 26 Nov 2009 18:18:10 -0800 (PST) MIME-Version: 1.0 Received: by 10.142.2.24 with SMTP id 24mr40888wfb.139.1259288290661; Thu, 26 Nov 2009 18:18:10 -0800 (PST) In-Reply-To: References: <4df04b840911231758md5a545el2d417b663af1647f@mail.gmail.com> <4df04b840911251824j71fa1d33i2cecc9481617dda5@mail.gmail.com> <4B0DF1EC.30001@redhat.com> <4df04b840911252204g33297e18m8e189c62a0662378@mail.gmail.com> Date: Fri, 27 Nov 2009 02:18:00 -0000 Message-ID: <4df04b840911261818q50f3da9bs3213c1a2982278f4@mail.gmail.com> Subject: Re: No .got section in ELF From: yunfeng zhang To: Alexandre Oliva Cc: Richard Henderson , gcc@gcc.gnu.org, Andrew Haley Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-11/txt/msg00759.txt.bz2 The rsult is also same, you go too far. Code I want to show a fact in Linux, when a process load a library into mem= ory, such as 0x1000 ---- foo.so 0x1000 ELF header .text section .data section .bss section ... Here data in 0x1000 and its follower have an *exact* map to foo.so in disk,= you need review my code, so which can bring an optimization is offsetof(C - A) = is const. Further, everything in data/bss section has a fixed offset to text section. 2009/11/26 Alexandre Oliva : > On Nov 26, 2009, yunfeng zhang wrote: > >> The result is the same > > But the code isn't. =A0See how, with hidden, we use the fixed offset. > > Now remove the hidden attribute, define g also in the main program, and > see what it prints. > > -- > Alexandre Oliva, freedom fighter =A0 =A0http://FSFLA.org/~lxoliva/ > You must be the change you wish to see in the world. -- Gandhi > Be Free! -- http://FSFLA.org/ =A0 FSF Latin America board member > Free Software Evangelist =A0 =A0 =A0Red Hat Brazil Compiler Engineer >