From: Tristan Gingold <gingold@adacore.com>
To: Daniel Jacobowitz <dan@codesourcery.com>
Cc: Jan Kratochvil <jan.kratochvil@redhat.com>, gdb-patches@sourceware.org
Subject: Re: Regression on prelinked-sepdebug-shlibs
Date: Thu, 07 Jan 2010 14:21:00 -0000 [thread overview]
Message-ID: <D7E39659-048F-4B86-B7ED-8C8CA4834D5A@adacore.com> (raw)
In-Reply-To: <20100107134201.GE22607@caradoc.them.org>
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 section whose vma is 0.
>
> 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 like 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=0 -nostdlib
$ readelf -S sep
There are 14 section headers, starting at offset 0x136c:
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf 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.
next prev parent reply other threads:[~2010-01-07 14:21 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-25 20:05 Jan Kratochvil
2010-01-04 9:50 ` Tristan Gingold
2010-01-04 10:24 ` Jan Kratochvil
2010-01-04 11:54 ` Tristan Gingold
2010-01-04 15:22 ` Tristan Gingold
2010-01-04 18:10 ` Jan Kratochvil
2010-01-05 11:02 ` Tristan Gingold
2010-01-05 16:15 ` Jan Kratochvil
2010-01-06 11:20 ` Tristan Gingold
2010-01-06 16:38 ` Tristan Gingold
2010-01-06 18:05 ` Jan Kratochvil
2010-01-06 19:16 ` Daniel Jacobowitz
2010-01-07 11:02 ` Tristan Gingold
2010-01-07 11:10 ` Jan Kratochvil
2010-01-07 11:18 ` Tristan Gingold
2010-01-07 13:42 ` Daniel Jacobowitz
2010-01-07 14:21 ` Tristan Gingold [this message]
2010-01-07 14:26 ` Daniel Jacobowitz
2010-01-07 14:37 ` Tristan Gingold
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=D7E39659-048F-4B86-B7ED-8C8CA4834D5A@adacore.com \
--to=gingold@adacore.com \
--cc=dan@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox