@@ -30,18 +30,34 @@ void __gcc_nested_func_ptr_created (void
void __gcc_nested_func_ptr_deleted (void);
#if __x86_64__
+
+#ifdef __LP64__
static const uint8_t trampoline_insns[] = {
- /* movabs $<func>,%r11 */
+ /* movabsq $<func>,%r11 */
0x49, 0xbb,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* movabs $<chain>,%r10 */
+ /* movabsq $<chain>,%r10 */
0x49, 0xba,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
/* rex.WB jmpq *%r11 */
0x41, 0xff, 0xe3
};
+#else
+static const uint8_t trampoline_insns[] = {
+ /* movl $<func>,%r11d */
+ 0x41, 0xbb,
+ 0x00, 0x00, 0x00, 0x00,
+
+ /* movl $<chain>,%r10d */
+ 0x41, 0xba,
+ 0x00, 0x00, 0x00, 0x00,
+
+ /* rex.WB jmpq *%r11 */
+ 0x41, 0xff, 0xe3
+};
+#endif
union ix86_trampoline {
uint8_t insns[sizeof(trampoline_insns)];