Skip to content

Commit

Permalink
AMD64: Add new PLT dynamic array tags (#224)
Browse files Browse the repository at this point in the history
Add new tags according to the x86-64 psABI [1]:

1. DT_LOPROC + 0 -> DT_X86_64_PLT:
   The address of the procedure linkage table.
2. DT_LOPROC + 1 -> DT_X86_64_PLTSZ:
   The total size, in bytes, of the procedure linkage table.
3. DT_LOPROC + 3 -> DT_X86_64_PLTENT:
   The size, in bytes, of a procedure linkage table entry. Always a power
   of 2.

1: https://gitlab.com/x86-psABIs/x86-64-ABI
2: See also https://sourceware.org/git/?p=glibc.git;a=commit;h=848746e88ec2aa22e8dea25f2110e2b2c59c712e
  • Loading branch information
mborgerson authored Jun 27, 2024
1 parent 26fa36b commit 4808fe7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions archinfo/arch_amd64.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,13 @@ def _configure_keystone(self):
Register(name="ss_seg", size=2, vex_name="ss"),
]

# https://gitlab.com/x86-psABIs/x86-64-ABI
dynamic_tag_translation = {
0x70000000: "DT_X86_64_PLT",
0x70000001: "DT_X86_64_PLTSZ",
0x70000003: "DT_X86_64_PLTENT",
}

symbol_type_translation = {10: "STT_GNU_IFUNC", "STT_LOOS": "STT_GNU_IFUNC"}
got_section_name = ".got.plt"
ld_linux_name = "ld-linux-x86-64.so.2"
Expand Down

0 comments on commit 4808fe7

Please sign in to comment.