diff options
Diffstat (limited to 'content/2019-11-18-dynamic-linking-linux-x86_64.md')
-rw-r--r-- | content/2019-11-18-dynamic-linking-linux-x86_64.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/content/2019-11-18-dynamic-linking-linux-x86_64.md b/content/2019-11-18-dynamic-linking-linux-x86_64.md index bc39e0f..496ec24 100644 --- a/content/2019-11-18-dynamic-linking-linux-x86_64.md +++ b/content/2019-11-18-dynamic-linking-linux-x86_64.md @@ -141,7 +141,7 @@ int main(int argc, const char* argv[]) { } ``` -```console +```bash > gcc -o main main.c -no-pie ``` @@ -209,7 +209,7 @@ To understand the `push 0` instruction in the **puts** trampoline we have to take a look at the third section of interest in the ELF file, the `.rela.plt` section. -```console +``` # -r print relocations # -D use .dynamic info when displaying info > readelf -W -r ./main @@ -250,7 +250,7 @@ The resulting index [2] is the offset into the dynamic symbol table (`.dynsym`). Dumping the dynamic symbol table with readelf we can see that the symbol at index [2] is **puts**. -```console +``` # -s print symbols > readelf -W -s ./main Symbol table '.dynsym' contains 7 entries: @@ -300,7 +300,7 @@ Following entries are most interesting for dynamic linking: We can use readelf to dump the `.dynamic` section. In the following snippet I only kept the relevant entries: -```console +``` # -d dump .dynamic section > readelf -d ./main |