Liste des Groupes | Revenir à cl c |
bart <bc@freeuk.com> writes:That's not right. That is exactly what base-relocation tables are for.On 28/06/2024 14:48, Scott Lurndal wrote:DLL code cannot, for example, use the movabs instruction or anybart <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.
other instruction that takes absolute addresses;
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 fixupThey 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.
non-PIC code at load time is fraught and pointless when compilers
have the capability of generating PIC code.
Only external interfaces (function addresses, global variables) shouldThis 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.
need relocation tables (GOT and PLT for ELF).
Les messages affichés proviennent d'usenet.