*BSD News Article 10562


Return to BSD News archive

Received: by minnie.vk1xwt.ampr.org with NNTP
	id AA303 ; Sun, 31 Jan 93 14:02:04 EST
Newsgroups: comp.unix.bsd
Path: sserve!manuel.anu.edu.au!munnari.oz.au!sgiblab!sdd.hp.com!think.com!paperboy.osf.org!meissner
From: meissner@osf.org (Michael Meissner)
Subject: Re: [386BSD] gcc2 and -fPIC
In-Reply-To: kaleb@jpl-devvax.jpl.nasa.gov's message of Wed, 27 Jan 1993 17:23:21 GMT
Message-ID: <MEISSNER.93Jan29145830@tiktok.osf.org>
Sender: news@osf.org (USENET News System)
Organization: Open Software Foundation
References: <1993Jan26.210430.27806@serval.net.wsu.edu>
	<1993Jan27.002600.21136@jpl-devvax.jpl.nasa.gov>
	<1993Jan27.044627.2756@serval.net.wsu.edu>
	<1993Jan27.172321.14231@jpl-devvax.jpl.nasa.gov>
Date: 29 Jan 93 14:58:30
Lines: 59

In article <1993Jan27.172321.14231@jpl-devvax.jpl.nasa.gov>
kaleb@jpl-devvax.jpl.nasa.gov (Kaleb Keithley) writes:

| Actually the patches I'm referring to are for SunOS on Sun386i, which
| is actually COFF.  At the risk of repeating myself, gcc itself doesn't
| yet support PIC on any 386, irrespective of anything else.

Hmmm, let me go over to our System V.4 (Dell) machine:

	-/u/meissner-> cat hello.c
	main(){ printf ("Hello World!\n"); return 0; }

	-/u/meissner-> gcc -fpic -O hello.c

	-/u/meissner-> a.out
	Hello World!

	-/u/meissner-> file a.out 
	a.out:          ELF 32-bit LSB executable 80386 Version 1

	-/u/meissner-> gcc -fpic -O -S hello.c

	-/u/meissner-> cat hello.s
		.file   "hello.c"
		.version        "01.01"
	gcc2_compiled.:
	.section        .rodata
	.LC0:
		.string "Hello World!\n"
	.text
		.align 4
	.globl main
		.type    main,@function
	main:
		pushl %ebp
		movl %esp,%ebp
		pushl %ebx
		call .L2
	.L2:
		popl %ebx
		addl $_GLOBAL_OFFSET_TABLE_+[.-.L2],%ebx
		leal .LC0@GOTOFF(%ebx),%eax
		pushl %eax
		call printf@PLT
		xorl %eax,%eax
		movl -4(%ebp),%ebx
		leave
		ret
	.Lfe1:
		.size    main,.Lfe1-main
		.ident  "GCC: (GNU) 2.3.2"

Sure looks like PIC to me.  Note, this is with GCC 2.2.2 (ie, ancient
history).  I haven't bothered installing 2.3.3 on that machine.
--
Michael Meissner	email: meissner@osf.org		phone: 617-621-8861
Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142

You are in a twisty little passage of standards, all conflicting.