Gentoo Archives: gentoo-hardened

From: Alexander Gabert <pappy@g.o>
To: "Peter S. Mazinger" <ps.m@×××.net>
Cc: Ned Ludd <solar@g.o>, gentoo-embedded@l.g.o, gentoo-hardened@l.g.o
Subject: Re: [gentoo-hardened] Re: (was) uclibc base system; arm and pie
Date: Thu, 24 Jun 2004 07:35:51
Message-Id: 40DA844B.7050804@gentoo.org
In Reply to: [gentoo-hardened] Re: (was) uclibc base system; arm and pie by "Peter S. Mazinger"
1 Peter S. Mazinger wrote:
2
3 > On 23 Jun 2004, Ned Ludd wrote:
4 >
5 >
6 >>Side Note Off Topic:
7 >>
8 >>Both arm & mips fail a simple
9 >>echo 'int main() { return 0; }' > main.c
10 >>gcc -o main main.c -pie
11 >>
12 >>/usr/lib/libc_nonshared.a(elf-init.oS)(.text+0x38): In function
13 >>`__libc_csu_init':
14 >>: undefined reference to `__init_array_start'
15 >>/usr/lib/libc_nonshared.a(elf-init.oS)(.text+0x3c): In function
16 >>`__libc_csu_init':
17 >>: undefined reference to `__init_array_end'
18 >>
19 >>I think these symbols are provided by linker scripts.
20 >>Seen anything floating around where others have run into the same thing?
21 >>If so recall the solution?
22 >
23 >
24 > Is the used gcc surely patched for pie?
25 > gcc (3.3.3+branch,3.4.0) does not support pie for arm (see my upstream
26 > pie patches for arm). at least gcc-3.3.3-piepatches-8.7.5,
27 > gcc-3.4.0-piepatches-8.7.6.1 have to be used.
28 > check if the startfile/endfile sections mention pie.
29 >
30 > mips could be another problem, because it defaults already to PIC.
31 >
32 > could you run gcc -v and send the result for both cases?
33 >
34 > Peter
35 >
36 >
37 > --
38 > gentoo-hardened@g.o mailing list
39 >
40 we already picked that out:
41 ld does not have a linker script for -pie on the affected arches:
42 the linker script normally contains a PROVIDE line for that.
43 simply copy the linker script for shared executables to the extension of
44 pie executables, this should be the "hack sluggish way" of doing things.
45
46
47 bye,
48
49 Alex (sunburned and happy pappy)
50 --
51 Chaos is just a perceptional disorder of reality.
52
53 --
54 gentoo-hardened@g.o mailing list

Replies