From 9925b31b757d09f633e3a0fc22b15e73537e5e65 Mon Sep 17 00:00:00 2001 From: Paula Toth Date: Thu, 30 Jan 2020 15:48:58 -0800 Subject: [PATCH 1/2] Fix typos in relocations doc --- docs/relocations.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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, From fc552021ebdae026749ca305608418ff1abbf266 Mon Sep 17 00:00:00 2001 From: Paula Toth Date: Thu, 30 Jan 2020 15:52:20 -0800 Subject: [PATCH 2/2] Fix typos in static pie doc --- docs/static_pie.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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