diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2015-11-23 17:07:51 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2015-11-23 17:07:51 +0000 |
commit | 114e179345185f1dcad9eb27cb3cd638af89f1be (patch) | |
tree | 3e326e81b7ca261f6dba201b10ffbc07010904c0 /sys/powerpc/include | |
parent | a77fc20235c4ecd2f8fb8ecacb81edf8ca596bcb (diff) | |
download | FreeBSD-src-114e179345185f1dcad9eb27cb3cd638af89f1be.zip FreeBSD-src-114e179345185f1dcad9eb27cb3cd638af89f1be.tar.gz |
Provide support for userland binaries using the new ELFv2 ABI. This is a
new, simplified, ELF ABI that avoids some of the stranger aspects of the
existing 64-bit PowerPC ABI (function descriptors, in particular). Actually
generating such executables requires a new version of binutils and a newer
compiler (either GCC or clang) than GCC 4.2.1.
Diffstat (limited to 'sys/powerpc/include')
-rw-r--r-- | sys/powerpc/include/asm.h | 2 | ||||
-rw-r--r-- | sys/powerpc/include/md_var.h | 4 | ||||
-rw-r--r-- | sys/powerpc/include/profile.h | 19 |
3 files changed, 19 insertions, 6 deletions
diff --git a/sys/powerpc/include/asm.h b/sys/powerpc/include/asm.h index c04cbc2..e5ec398 100644 --- a/sys/powerpc/include/asm.h +++ b/sys/powerpc/include/asm.h @@ -85,7 +85,9 @@ .section ".toc","aw"; \ TOC_REF(name): \ .tc name[TC],name +#endif +#if defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1) #define _ENTRY(name) \ .section ".text"; \ .p2align 2; \ diff --git a/sys/powerpc/include/md_var.h b/sys/powerpc/include/md_var.h index a90967a..f9d4ef1 100644 --- a/sys/powerpc/include/md_var.h +++ b/sys/powerpc/include/md_var.h @@ -37,8 +37,8 @@ extern char sigcode32[]; extern int szsigcode32; #ifdef __powerpc64__ -extern char sigcode64[]; -extern int szsigcode64; +extern char sigcode64[], sigcode64_elfv2[]; +extern int szsigcode64, szsigcode64_elfv2; #endif extern long Maxmem; diff --git a/sys/powerpc/include/profile.h b/sys/powerpc/include/profile.h index eb11fc9..b1481a7 100644 --- a/sys/powerpc/include/profile.h +++ b/sys/powerpc/include/profile.h @@ -75,9 +75,10 @@ typedef __ptrdiff_t fptrdiff_t; * to be restored to what it was on entry to the profiled routine. */ -#ifdef __powerpc64__ -#define MCOUNT \ -__asm( " .text \n" \ +#if defined(__powerpc64__) + +#if !defined(_CALL_ELF) || _CALL_ELF == 1 +#define MCOUNT_PREAMBLE \ " .align 2 \n" \ " .globl _mcount \n" \ " .section \".opd\",\"aw\" \n" \ @@ -88,7 +89,17 @@ __asm( " .text \n" \ " .size _mcount,24 \n" \ " .type _mcount,@function \n" \ " .align 4 \n" \ - ".L._mcount: \n" \ + ".L._mcount: \n" +#else +#define MCOUNT_PREAMBLE \ + " .globl _mcount \n" \ + " .type _mcount,@function \n" \ + " .align 4 \n" \ + "_mcount: \n" +#endif + +#define MCOUNT \ +__asm( MCOUNT_PREAMBLE \ " stdu %r1,-(288+128)(%r1) \n" \ " std %r3,48(%r1) \n" \ " std %r4,56(%r1) \n" \ |