diff --git a/docs/relocations.md b/docs/relocations.md index 2097ac9..0080519 100644 --- a/docs/relocations.md +++ b/docs/relocations.md @@ -4,16 +4,16 @@ ELF file of a statically linked non-PIE will have relocations to support [_ifuncs_](https://github.com/sivachandra/elf-by-example/tree/master/examples/ifunc). ELF file of a statically linked PIE will additional have one specific kind of dynamic relocations. These relocations are required to adjust for the -load address (a [PIE](pie.md) is loaded at a different address everyone time it +load address (a [PIE](pie.md) is loaded at a different address every time it runs). See this [example](https://github.com/sivachandra/elf-by-example/tree/master/examples/global_var_ptr) -for more elaborate illustration. +for a more elaborate illustration. ## What are linker generated relocations? A coworker once asked, "Aren't relocations generated by the compiler/assembler? What are linker generated relocations?" It is true that the compiler and/or the assembler generate the relocations. The static linker makes use of these -relocations to performing the linking. Some values, like global variable +relocations to perform the linking. Some values, like global variable addresses in a PIE, can only be known after the program starts. For such values, the linker typically replaces the compiler generated relocations with its own relocations which are most suitable for the linking mode used (for example, diff --git a/docs/static_pie.md b/docs/static_pie.md index 1d18972..0cab3e9 100644 --- a/docs/static_pie.md +++ b/docs/static_pie.md @@ -12,7 +12,7 @@ static-pie binary are explained in A statically linked PIE binary differs from a dynamically linked PIE binary in the following ways: -1. As there are no dynamic libraries to be loaded, they is no need of the +1. As there are no dynamic libraries to be loaded, there is no need for the program interpreter. Consequently, there is no `PT_INTERP` segment in a static-pie binary. 1. The dynamic section will not have `DT_NEEDED` entries as a static-pie binary