Ghidra is a software reverse engineering (SRE) framework
GP-3320 Updated cspec files with callfixes for modern gcc
16353217878721fbf28
diff --git a/Ghidra/Processors/x86/data/languages/x86-64-gcc.cspec b/Ghidra/Processors/x86/data/languages/x86-64-gcc.cspecindex 7b7ca23010..df20e918fd 100644--- a/Ghidra/Processors/x86/data/languages/x86-64-gcc.cspec+++ b/Ghidra/Processors/x86/data/languages/x86-64-gcc.cspec@@ -239,4 +239,135 @@<register name="RBP"/></returnaddress></prototype>++ <callfixup name="x86_return_thunk">+ <target name="__x86_return_thunk"/>+ <pcode>+ <body><![CDATA[+ RIP = *:8 RSP;+ RSP = RSP + 8;+ return [RIP];+ ]]></body>+ </pcode>+ </callfixup>+ <callfixup name="fentry">+ <target name="__fentry__"/>+ <pcode>+ <body><![CDATA[+ temp:1 = 0;+ ]]></body>+ </pcode>+ </callfixup>+ <callfixup name="mcount">+ <target name="mcount"/>+ <pcode>+ <body><![CDATA[+ temp:1 = 0;+ ]]></body>+ </pcode>+ </callfixup>+ <callfixup name="x86_indirect_thunk_rbp">+ <target name="__x86_indirect_thunk_rbp"/>+ <pcode>+ <body><![CDATA[+ call [RBP];+ ]]></body>+ </pcode>+ </callfixup>+ <callfixup name="x86_indirect_thunk_rax">+ <target name="__x86_indirect_thunk_rax"/>+ <pcode>+ <body><![CDATA[+ call [RAX];+ ]]></body>+ </pcode>+ </callfixup>+ <callfixup name="x86_indirect_thunk_rbx">+ <target name="__x86_indirect_thunk_rbx"/>+ <pcode>+ <body><![CDATA[+ call [RBX];+ ]]></body>+ </pcode>+ </callfixup>+ <callfixup name="x86_indirect_thunk_rcx">+ <target name="__x86_indirect_thunk_rcx"/>+ <pcode>+ <body><![CDATA[+ call [RCX];+ ]]></body>+ </pcode>+ </callfixup>+ <callfixup name="x86_indirect_thunk_rdx">+ <target name="__x86_indirect_thunk_rdx"/>+ <pcode>+ <body><![CDATA[+ call [RDX];+ ]]></body>+ </pcode>+ </callfixup>+ <callfixup name="x86_indirect_thunk_r8">+ <target name="__x86_indirect_thunk_r8"/>+ <pcode>+ <body><![CDATA[+ call [R8];+ ]]></body>+ </pcode>+ </callfixup>+ <callfixup name="x86_indirect_thunk_r9">+ <target name="__x86_indirect_thunk_r9"/>+ <pcode>+ <body><![CDATA[+ call [R9];+ ]]></body>+ </pcode>+ </callfixup>+ <callfixup name="x86_indirect_thunk_r10">+ <target name="__x86_indirect_thunk_r10"/>+ <pcode>+ <body><![CDATA[+ call [R10];+ ]]></body>+ </pcode>+ </callfixup>+ <callfixup name="x86_indirect_thunk_r11">+ <target name="__x86_indirect_thunk_r11"/>+ <pcode>+ <body><![CDATA[+ call [R11];+ ]]></body>+ </pcode>+ </callfixup>+ <callfixup name="x86_indirect_thunk_r12">+ <target name="__x86_indirect_thunk_r12"/>+ <pcode>+ <body><![CDATA[+ call [R12];+ ]]></body>+ </pcode>+ </callfixup>+ <callfixup name="x86_indirect_thunk_r13">+ <target name="__x86_indirect_thunk_r13"/>+ <pcode>+ <body><![CDATA[+ call [R13];+ ]]></body>+ </pcode>+ </callfixup>+ <callfixup name="x86_indirect_thunk_r14">+ <target name="__x86_indirect_thunk_r14"/>+ <pcode>+ <body><![CDATA[+ call [R14];+ ]]></body>+ </pcode>+ </callfixup>+ <callfixup name="x86_indirect_thunk_r15">+ <target name="__x86_indirect_thunk_r15"/>+ <pcode>+ <body><![CDATA[+ call [R15];+ ]]></body>+ </pcode>+ </callfixup></compiler_spec>diff --git a/Ghidra/Processors/x86/data/languages/x86gcc.cspec b/Ghidra/Processors/x86/data/languages/x86gcc.cspecindex bcd049d2d2..99a4904ae5 100644--- a/Ghidra/Processors/x86/data/languages/x86gcc.cspec+++ b/Ghidra/Processors/x86/data/languages/x86gcc.cspec@@ -364,7 +364,7 @@</pcode></callfixup>- <callfixup name="get_pc_thunk_si">+ <callfixup name="get_pc_thunk_si"><target name="__i686.get_pc_thunk.si"/><target name="__x86.get_pc_thunk.si"/><pcode>@@ -374,4 +374,71 @@]]></body></pcode></callfixup>++ <callfixup name="x86_return_thunk">+ <target name="__x86_return_thunk"/>+ <pcode>+ <body><![CDATA[+ EIP = *:4 ESP;+ ESP = ESP + 4;+ return [EIP];+ ]]></body>+ </pcode>+ </callfixup>+ <callfixup name="fentry">+ <target name="__fentry__"/>+ <pcode>+ <body><![CDATA[+ temp:1 = 0;+ ]]></body>+ </pcode>+ </callfixup>+ <callfixup name="mcount">+ <target name="mcount"/>+ <pcode>+ <body><![CDATA[+ temp:1 = 0;+ ]]></body>+ </pcode>+ </callfixup>+ <callfixup name="x86_indirect_thunk_ebp">+ <target name="__x86_indirect_thunk_ebp"/>+ <pcode>+ <body><![CDATA[+ call [EBP];+ ]]></body>+ </pcode>+ </callfixup>+ <callfixup name="x86_indirect_thunk_eax">+ <target name="__x86_indirect_thunk_eax"/>+ <pcode>+ <body><![CDATA[+ call [EAX];+ ]]></body>+ </pcode>+ </callfixup>+ <callfixup name="x86_indirect_thunk_ebx">+ <target name="__x86_indirect_thunk_ebx"/>+ <pcode>+ <body><![CDATA[+ call [EBX];+ ]]></body>+ </pcode>+ </callfixup>+ <callfixup name="x86_indirect_thunk_ecx">+ <target name="__x86_indirect_thunk_ecx"/>+ <pcode>+ <body><![CDATA[+ call [ECX];+ ]]></body>+ </pcode>+ </callfixup>+ <callfixup name="x86_indirect_thunk_edx">+ <target name="__x86_indirect_thunk_edx"/>+ <pcode>+ <body><![CDATA[+ call [EDX];+ ]]></body>+ </pcode>+ </callfixup></compiler_spec>