From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16448 invoked by alias); 7 Jan 2010 14:21:41 -0000 Received: (qmail 16438 invoked by uid 22791); 7 Jan 2010 14:21:40 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (212.99.106.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Jan 2010 14:21:33 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 0700BCB0227; Thu, 7 Jan 2010 15:21:31 +0100 (CET) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xDXGK7Xj3wzH; Thu, 7 Jan 2010 15:21:30 +0100 (CET) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id E1438CB01D7; Thu, 7 Jan 2010 15:21:30 +0100 (CET) Subject: Re: Regression on prelinked-sepdebug-shlibs Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Tristan Gingold In-Reply-To: <20100107134201.GE22607@caradoc.them.org> Date: Thu, 07 Jan 2010 14:21:00 -0000 Cc: Jan Kratochvil , gdb-patches@sourceware.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20091225200440.GA3747@host0.dyn.jankratochvil.net> <20100106180510.GA6748@host0.dyn.jankratochvil.net> <20100106191608.GA28581@caradoc.them.org> <20100107134201.GE22607@caradoc.them.org> To: Daniel Jacobowitz X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-01/txt/msg00137.txt.bz2 On Jan 7, 2010, at 2:42 PM, Daniel Jacobowitz wrote: > On Thu, Jan 07, 2010 at 12:03:04PM +0100, Tristan Gingold wrote: >> I am not sure that you can create a linux native executable with a secti= on whose vma is 0. >=20 > I'm pretty sure you can't. The program headers are going to be at the > start of the executable, before any section. So I'm not entirely sure > what kind of executable you get from doing this :-) You lost me. They can be on different pages ? In fact I can build such a statically linked program. However it looks lik= e ld.so or libc doesn't like such a program (also it is buildable). $ cat sep.c int zero (void) __attribute__((section("sec_zero"))); int zero (void) { return 12; } void _start (void) { asm volatile ("int $0x80" : : "a"(1), "b"(zero())); } $ gcc -c -g -m32 sep.c $ gcc -m32 -o sep sep.o -Wl,--section-start,sec_zero=3D0 -nostdlib $ readelf -S sep There are 14 section headers, starting at offset 0x136c: Section Headers: [Nr] Name Type Addr Off Size ES Flg Lk I= nf Al [ 0] NULL 00000000 000000 000000 00 0 = 0 0 [ 1] sec_zero PROGBITS 00000000 001000 00000a 00 AX 0 = 0 1 [ 2] .text PROGBITS 08048094 001094 000015 00 AX 0 = 0 4 [ 3] .comment PROGBITS 00000000 0010a9 00002e 00 0 = 0 1 [ 4] .debug_aranges PROGBITS 00000000 0010d7 000028 00 0 = 0 1 [ 5] .debug_pubnames PROGBITS 00000000 0010ff 000026 00 0 = 0 1 [ 6] .debug_info PROGBITS 00000000 001125 00008c 00 0 = 0 1 [ 7] .debug_abbrev PROGBITS 00000000 0011b1 000047 00 0 = 0 1 [ 8] .debug_line PROGBITS 00000000 0011f8 000044 00 0 = 0 1 [ 9] .debug_frame PROGBITS 00000000 00123c 000048 00 0 = 0 4 [10] .debug_loc PROGBITS 00000000 001284 000058 00 0 = 0 1 [11] .shstrtab STRTAB 00000000 0012dc 000090 00 0 = 0 1 [12] .symtab SYMTAB 00000000 00159c 000110 10 13 = 12 4 [13] .strtab STRTAB 00000000 0016ac 00002b 00 0 = 0 1 Tristan.