Content deleted Content added
GreenC bot (talk | contribs) Reformat 1 archive link. Wayback Medic 2.5 per WP:URLREQ#citeftp |
review: research and clarify Windows and ALSR with ref |
||
(One intermediate revision by the same user not shown) | |||
Line 18:
The relocation table is a list of addresses created by a [[compiler]] or [[Assembler (computer programming)#Assembler|assembler]] and stored in the object or executable file. Each entry in the table references an absolute address in the object code that must be changed when the loader relocates the program so that it will refer to the correct ___location. Entries in the relocation table are known as ''fixups'' and are designed to support relocation of the program as a complete unit. In some cases, each fixup in the table is itself relative to a base address of zero, so the fixups themselves must be changed as the loader moves through the table.<ref name="Levine_1999_CH1_CH3"/>
In some architectures, a fixup that crosses certain boundaries (such as a segment boundary) or that is not aligned on a word boundary is illegal and flagged as an error by the linker.<ref name="Borland_2007"/>
=== DOS and 16-bit Windows ===
Far [[pointer (computer programming)|pointer]]s ([[32-bit]] pointers with [[x86 memory segmentation|segment]]:offset, used to address 20-bit 640
Instead, segments are relative values in the DOS EXE file. These segments need to be corrected, when the executable has been loaded into memory. The EXE [[loader (computing)|loader]] uses a relocation table to find the segments
===
With 32-bit Windows operating systems, it is not mandatory to provide relocation tables for EXE files, since they are the first image loaded into the virtual address space and thus will be loaded at their preferred base address.
For both [[Dynamic Link Library|DLL]]s and for EXEs which opt into [[address space layout randomization]] (ASLR), an [[exploit (computer security)|exploit]] mitigation technique introduced with [[Windows Vista]], relocation tables once again become mandatory because of the possibility that the binary may be dynamically moved before being executed, even though they are still the first thing loaded in the virtual address space.
Windows executables can be marked as ASLR-compatible. The ability exits in Windows 8 and newer to enable ASLR even for applications not marked as compatible.<ref>{{cite web |url=https://cloud.google.com/blog/topics/threat-intelligence/six-facts-about-address-space-layout-randomization-on-windows |title=Six Facts about Address Space Layout Randomization on Windows |date=March 17, 2020 |access-date=July 24, 2020}}</ref> To run successfully in this envoronment the relocation sections cannot be omitted by the compiler.<!--[[User:Kvng/RTH]]-->
=== Unix-like systems ===
|