pushl main@GOT(%ebx)
# else
/* Avoid relocation in static PIE since _start is called before
- it is relocated. Don't use "leal main@GOTOFF(%ebx), %eax"
- since main may be in a shared object. Linker will convert
- "movl main@GOT(%ebx), %eax" to "leal main@GOTOFF(%ebx), %eax"
+ it is relocated. This also avoid rely on linker optimization to
+ transform 'movl main@GOT(%ebx), %eax' to 'leal main@GOTOFF(%ebx)'
if main is defined locally. */
- movl main@GOT(%ebx), %eax
+ leal __wrap_main@GOTOFF(%ebx), %eax
pushl %eax
# endif
1: movl (%esp), %ebx
ret
#endif
+
+#if defined PIC && !defined SHARED
+__wrap_main:
+ _CET_ENDBR
+ jmp main@PLT
+#endif
END (_start)
/* To fulfill the System V/i386 ABI we need this symbol. Yuck, it's so