#endif
 
 #if defined(CONFIG_FTRACE_SYSCALLS) && defined(CONFIG_PPC64) && !defined(__ASSEMBLY__)
+#if !defined(_CALL_ELF) || _CALL_ELF != 2
 #define ARCH_HAS_SYSCALL_MATCH_SYM_NAME
 static inline bool arch_syscall_match_sym_name(const char *sym, const char *name)
 {
         */
        return !strcmp(sym + 4, name + 3);
 }
+#endif
 #endif /* CONFIG_FTRACE_SYSCALLS && CONFIG_PPC64 && !__ASSEMBLY__ */
 
 #endif /* _ASM_POWERPC_FTRACE */
 
 #define _ASM_POWERPC_LINKAGE_H
 
 #ifdef CONFIG_PPC64
+#if !defined(_CALL_ELF) || _CALL_ELF != 2
 #define cond_syscall(x) \
        asm ("\t.weak " #x "\n\t.set " #x ", sys_ni_syscall\n"          \
             "\t.weak ." #x "\n\t.set ." #x ", .sys_ni_syscall\n")
        asm ("\t.globl " #alias "\n\t.set " #alias ", " #name "\n"      \
             "\t.globl ." #alias "\n\t.set ." #alias ", ." #name)
 #endif
+#endif
 
 #endif /* _ASM_POWERPC_LINKAGE_H */
 
 #define __STK_PARAM(i) (48 + ((i)-3)*8)
 #define STK_PARAM(i)   __STK_PARAM(__REG_##i)
 
+#if defined(_CALL_ELF) && _CALL_ELF == 2
+
+#define _GLOBAL(name) \
+       .section ".text"; \
+       .align 2 ; \
+       .type name,@function; \
+       .globl name; \
+name:
+
+#define _KPROBE(name) \
+       .section ".kprobes.text","a"; \
+       .align 2 ; \
+       .type name,@function; \
+       .globl name; \
+name:
+
+#define DOTSYM(a)      a
+
+#else
+
 #define XGLUE(a,b) a##b
 #define GLUE(a,b) XGLUE(a,b)
 
 
 #define DOTSYM(a)      GLUE(.,a)
 
+#endif
+
 #else /* 32-bit */
 
 #define _ENTRY(n)      \