Re: Baby X is bor nagain

Liste des GroupesRevenir à cl c  
Sujet : Re: Baby X is bor nagain
De : bc (at) *nospam* freeuk.com (bart)
Groupes : comp.lang.c
Date : 28. Jun 2024, 20:37:59
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v5n3em$3fpds$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
User-Agent : Mozilla Thunderbird
On 28/06/2024 16:48, Scott Lurndal wrote:
bart <bc@freeuk.com> writes:
On 28/06/2024 14:48, Scott Lurndal wrote:
bart <bc@freeuk.com> writes:
On 28/06/2024 04:30, Kaz Kylheku wrote:
On 2024-06-27, bart <bc@freeuk.com> wrote:
For most, PIC isn't a necessity.
>
Only because they use a virtual memory operating system which allows
every executable to be mapped to the same fixed address in its own
address space.
>
PIC never seemed to be a requirement during the 1980s and half the 90s.
But then OSes only ran one program a time.
>
Interactive operating systems in 1967 (e.g. TSS8) were running
multiple programs at a time.
>
>
And when virtual addressing came along, and multiple programs could
co-exist at the same address, PIC wasn't really needed either.
>
Virtual addressing has been part of computer systems since the 1960s.
>
PIC is obviously necessary for any kind of shared code (shared object
or DLL) that gets loaded at different base addressses in different
processes.
>
I wouldn't call that PIC. On Windows, DLLs need base-relocation tables.
 DLL code cannot, for example, use the movabs instruction or any
other instruction that takes absolute addresses;
That's not right. That is exactly what base-relocation tables are for.

relocatable code generated needs to be position independent.
Um, not it doesn't. If writing object files, then lots will be relocatable, but once it gets linked into executable, that need not be relocatable nor position independent.

Trying to fixup
non-PIC code at load time is fraught and pointless when compilers
have the capability of generating PIC code.
They might do depending on what conveniences the instruction set offers. There was a reason why RIP-relative addresses was introduced on x64. But the compiler still has to on-side. That's where people like me come in.

Only external interfaces (function addresses, global variables) should
need relocation tables (GOT and PLT for ELF).
This is where some people might get the misleading idea that with PIC, you can take an individual function and just move it anywhere. If you have references to it at 100 call-sites, they will need updating! Plus any calls that exist inside that function will need changing.
PIC applies to a whole unit like an EXE or DLL file.
 >Your experiences seem limited to PC systems.
I've used PCs a lot yes; so?
I've also used PDP10, PDP11 and ICL equipment. I've written assemblers which directly generated machine code for devices like Z80, 8051, 80188 (a special version of 8088). All this was long before I first used a PC.
Funnily enough, PIC for native code executables never came up that I can remember.

Date Sujet#  Auteur
27 Jun 24 * Re: Baby X is bor nagain36Tim Rentsch
27 Jun 24 +* Re: Baby X is bor nagain2Keith Thompson
28 Jun 24 i`- Re: Baby X is bor nagain1Tim Rentsch
28 Jun 24 +* Re: Baby X is bor nagain11bart
28 Jun 24 i+- Re: Baby X is bor nagain1Tim Rentsch
28 Jun 24 i+- Re: Baby X is bor nagain1Tim Rentsch
28 Jun 24 i+* Re: Baby X is bor nagain7Kaz Kylheku
28 Jun 24 ii+- Re: Baby X is bor nagain1Michael S
28 Jun 24 ii`* Re: Baby X is bor nagain5bart
28 Jun 24 ii +* Re: Baby X is bor nagain2bart
28 Jun 24 ii i`- Re: Baby X is bor nagain1bart
28 Jun 24 ii `* Re: Baby X is bor nagain2bart
28 Jun 24 ii  `- Re: Baby X is bor nagain1Michael S
28 Jun 24 i`- Re: Baby X is bor nagain1bart
1 Jul 24 `* tcc - first impression. Was: Baby X is bor nagain22Michael S
1 Jul 24  +- Re: tcc - first impression. Was: Baby X is bor nagain1Tim Rentsch
1 Jul 24  +* Re: tcc - first impression. Was: Baby X is bor nagain13Keith Thompson
1 Jul 24  i+- Re: tcc - first impression. Was: Baby X is bor nagain1Keith Thompson
2 Jul 24  i+* Re: tcc - first impression. Was: Baby X is bor nagain9Michael S
2 Jul 24  ii+* Re: tcc - first impression. Was: Baby X is bor nagain6bart
2 Jul 24  iii+* Re: tcc - first impression. Was: Baby X is bor nagain4Michael S
2 Jul 24  iiii+* Re: tcc - first impression. Was: Baby X is bor nagain2bart
2 Jul 24  iiiii`- Re: tcc - first impression. Was: Baby X is bor nagain1Michael S
3 Jul 24  iiii`- Re: tcc - first impression. Was: Baby X is bor nagain1Michael S
2 Jul 24  iii`- Re: tcc - first impression. Was: Baby X is bor nagain1Tim Rentsch
2 Jul 24  ii+- Re: tcc - first impression. Was: Baby X is bor nagain1Tim Rentsch
2 Jul 24  ii`- Re: tcc - first impression. Was: Baby X is bor nagain1James Kuyper
2 Jul 24  i`* Re: tcc - first impression. Was: Baby X is bor nagain2Malcolm McLean
2 Jul 24  i `- Re: tcc - first impression. Was: Baby X is bor nagain1Ben Bacarisse
2 Jul 24  +* Re: tcc - first impression. Was: Baby X is bor nagain6Michael S
2 Jul 24  i+* Re: tcc - first impression. Was: Baby X is bor nagain4Ben Bacarisse
2 Jul 24  ii`* Re: tcc - first impression. Was: Baby X is bor nagain3Michael S
2 Jul 24  ii `* Re: tcc - first impression. Was: Baby X is bor nagain2Ben Bacarisse
2 Jul 24  ii  `- Re: tcc - first impression. Was: Baby X is bor nagain1Michael S
3 Jul 24  i`- Re: tcc - first impression. Was: Baby X is bor nagain1Michael S
3 Jul 24  `- Re: tcc - first impression. Was: Baby X is bor nagain1Michael S

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal