Date: Sun, 4 Mar 2012 11:55:28 +0000 (UTC) From: Andreas Tobler <andreast@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r232488 - head/sys/powerpc/include Message-ID: <201203041155.q24BtSZn033447@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: andreast Date: Sun Mar 4 11:55:28 2012 New Revision: 232488 URL: http://svn.freebsd.org/changeset/base/232488 Log: Restore proper dot symbol creation for assembly files in the kernel build case. Without this patch we were not able to see the assembly function. Only the function descriptor was visible. - Distinguish between user-land and kernel when creating the ENTRY() point of assembly source. - Make the ENTRY() macro more readable, replace the .align directive with the gas platform independant .p2align directive. - Create an END()macro for later use to provide traceback tables on powerpc64. Modified: head/sys/powerpc/include/asm.h Modified: head/sys/powerpc/include/asm.h ============================================================================== --- head/sys/powerpc/include/asm.h Sun Mar 4 11:11:03 2012 (r232487) +++ head/sys/powerpc/include/asm.h Sun Mar 4 11:55:28 2012 (r232488) @@ -61,19 +61,51 @@ #define HIDENAME(asmsym) __CONCAT(.,asmsym) #endif -#define _GLOBAL(x) \ - .data; .align 2; .globl x; x: - -#ifdef __powerpc64__ -#define _ENTRY(x) \ - .text; .align 2; .globl x; .section ".opd","aw"; \ - .align 3; x: \ - .quad .L.x,.TOC.@tocbase,0; .size x,24; .previous; \ - .align 4; .type x,@function; .L.x: -#else -#define _ENTRY(x) \ - .text; .align 4; .globl x; .type x,@function; x: -#endif +#ifdef _KERNEL +#define DOT_LABEL(name) __CONCAT(.,name) +#define TYPE_ENTRY(name) .size name,24; \ + .type DOT_LABEL(name),@function; \ + .globl DOT_LABEL(name); +#define END_SIZE(name) .size DOT_LABEL(name),.-DOT_LABEL(name); +#else /* !_KERNEL */ +#define DOT_LABEL(name) __CONCAT(.L.,name) +#define TYPE_ENTRY(name) .type name,@function; +#define END_SIZE(name) .size name,.-DOT_LABEL(name); +#endif /* _KERNEL */ + +#define _GLOBAL(name) \ + .data; \ + .p2align 2; \ + .globl name; \ + name: + +#ifdef __powerpc64__ +#define _ENTRY(name) \ + .section ".text"; \ + .p2align 2; \ + .globl name; \ + .section ".opd","aw"; \ + .p2align 3; \ + name: \ + .quad DOT_LABEL(name),.TOC.@tocbase,0; \ + .previous; \ + .p2align 4; \ + TYPE_ENTRY(name) \ +DOT_LABEL(name): + +#define _END(name) \ + .long 0; \ + .byte 0,0,0,0,0,0,0,0; \ + END_SIZE(name) +#else /* !__powerpc64__ */ +#define _ENTRY(name) \ + .text; \ + .p2align 4; \ + .globl name; \ + .type name,@function; \ + name: +#define _END(name) +#endif /* __powerpc64__ */ #if defined(PROF) || (defined(_KERNEL) && defined(GPROF)) # ifdef __powerpc64__ @@ -99,6 +131,7 @@ #endif #define ASENTRY(y) _ENTRY(ASMNAME(y)); _PROF_PROLOGUE +#define END(y) _END(CNAME(y)) #define ENTRY(y) _ENTRY(CNAME(y)); _PROF_PROLOGUE #define GLOBAL(y) _GLOBAL(CNAME(y))
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203041155.q24BtSZn033447>