Subject: Re: gcc -fPIC/-fpic and 'const'
To: =?ISO-8859-1?Q?Jarom=EDr_Dolecek?= <jdolecek@netbsd.org>
From: Todd Vierling <tv@wasabisystems.com>
List: tech-userlevel
Date: 03/01/2001 15:59:20
On Thu, 1 Mar 2001, Jaromír Dolecek wrote:

: > Note that on ELF, .text is not the only read-only section.  There are
: > several possible ones; .rodata is actually supposed to be mapped read-only
: > and *non-executable* where possible.  8-)
:
: Ah, OK :) I was confused by the size(1) output, which was different
: for fpic and non-fpic version.

Hm?  In the default output of the GNU-based size(1) ("BSD style"), I get:

$ cc -c x.c
$ size x.o
text    data    bss     dec     hex     filename
5       0       0       5       5       x.o

$ cc -fPIC -c x.c
$ size x.o
text    data    bss     dec     hex     filename
5       0       0       5       5       x.o

"size -A" will report it per ELF section (System V style).

-- 
-- Todd Vierling <tv@wasabisystems.com>  *  Wasabi NetBSD:  Run with it.
-- NetBSD 1.5 now available on CD-ROM  --  http://www.wasabisystems.com/