Deutsch   English   Français   Italiano  
<v5m2g6$39qob$2@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!feed.opticnetworks.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bart <bc@freeuk.com>
Newsgroups: comp.lang.c
Subject: Re: Baby X is bor nagain
Date: Fri, 28 Jun 2024 11:15:36 +0100
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <v5m2g6$39qob$2@dont-email.me>
References: <v494f9$von8$1@dont-email.me> <v5c86d$11ac7$1@dont-email.me>
 <JEheO.108086$ED9b.74955@fx11.iad> <v5cblg$11q0j$1@dont-email.me>
 <gEieO.108089$ED9b.25598@fx11.iad> <20240625113616.000075e0@yahoo.com>
 <mUzeO.141609$Cqra.55051@fx10.iad> <v5elql$1jmii$1@dont-email.me>
 <m3BeO.24907$Gurd.16179@fx34.iad> <v5empd$1jndv$2@dont-email.me>
 <v5eph4$1k6a9$1@dont-email.me> <87ed8jnbmf.fsf@bsb.me.uk>
 <v5jhls$2m7np$1@dont-email.me> <867ceadtih.fsf@linuxsc.com>
 <v5krsp$2v9va$1@dont-email.me> <K0nfO.155094$7NFd.18547@fx16.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 28 Jun 2024 12:15:35 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="e7f1b554b99247d34cf39342a3f15f64";
	logging-data="3468043"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+3OeZ/nXKf4tLCkdsgXKOe"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:VulTm6IEnL8bz5+STB2wXm4oLfY=
In-Reply-To: <K0nfO.155094$7NFd.18547@fx16.iad>
Content-Language: en-GB
Bytes: 3215

On 28/06/2024 00:58, Scott Lurndal wrote:
> bart <bc@freeuk.com> writes:
>> On 27/06/2024 21:23, Tim Rentsch wrote:
> 
>>> After taking care of all that the build did manage to produce an
>>> executable, which appears to have run successfully.
>>>
>>> After doing a trial run with the produced executable, I looked at
>>> the tcc man page.  As best I can tell, tcc simply silently
>>> ignores the -fPIC option.
>>
>> I think that it tries to be a drop-in replacement for gcc, so supports
>> some of its options, even if they don't do anything. Like -O3.
>>
>> Position-independent code seems to be a recent thing with gcc tools. My
>> tools didn't support it either, until a year ago when I found out about
>> ASLR.
> 
> gcc has supported generating position independent code for at
> over a quarter of a century.

I'm pretty sure that just 4 years ago, I was able to generate non-PIC 
object files that could be linked with gcc-ld on Windows.

When I tried it last year, it didn't work. So something changed, whether 
in compiler, or OS loader, where a dynamic image base address, which 
requires PIC, became the default.


>>
>> For most, PIC isn't a necessity.
> 
> That's your opinion. I don't think it matches reality.

The fact that it hasn't been needed, or been the default, for decades 
suggests that it isn't a necessity.

A 'necessity' isn't someone arbitrarily decreeing: 'all code must be PIC'.

If you took any Windows EXE and changed some flags in the headers, so 
loading at the given base address, it would probably still work.


> For most applications it doesn't matter and PIC code
> works just as well as PDC.

Hang on, isn't that what /I/ said, which you just disagreed with?