diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2011-02-18 21:44:53 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2011-02-18 21:44:53 +0000 |
commit | 699ef3129bdda98a0a0164e4d221a0273dfc24d8 (patch) | |
tree | e069082d5276eb511e5621c24cb299f4d260312d | |
parent | 58abb279f50d5ad9fbad30a39da04296664ec6cb (diff) | |
download | FreeBSD-src-699ef3129bdda98a0a0164e4d221a0273dfc24d8.zip FreeBSD-src-699ef3129bdda98a0a0164e4d221a0273dfc24d8.tar.gz |
Turn off default generation of userland dot symbols on powerpc64 now that
we have a binutils that supports it. Kernel dot symbols remain on to assist
DDB.
-rw-r--r-- | contrib/gcc/config/rs6000/freebsd.h | 9 | ||||
-rw-r--r-- | lib/csu/powerpc64/crti.S | 14 | ||||
-rw-r--r-- | lib/libc/gen/_thread_init.c | 2 | ||||
-rw-r--r-- | lib/libc/powerpc64/SYS.h | 16 | ||||
-rw-r--r-- | lib/libc/powerpc64/gen/_ctx_start.S | 5 | ||||
-rw-r--r-- | lib/libc/powerpc64/sys/brk.S | 2 | ||||
-rw-r--r-- | lib/libc/powerpc64/sys/cerror.S | 2 | ||||
-rw-r--r-- | lib/libc/powerpc64/sys/exect.S | 2 | ||||
-rw-r--r-- | lib/libc/powerpc64/sys/pipe.S | 2 | ||||
-rw-r--r-- | lib/libc/powerpc64/sys/ptrace.S | 4 | ||||
-rw-r--r-- | lib/libc/powerpc64/sys/sbrk.S | 2 | ||||
-rw-r--r-- | libexec/rtld-elf/powerpc64/rtld_start.S | 6 | ||||
-rw-r--r-- | sys/conf/kern.mk | 7 | ||||
-rw-r--r-- | sys/powerpc/aim/locore64.S | 8 | ||||
-rw-r--r-- | sys/powerpc/aim/swtch64.S | 14 | ||||
-rw-r--r-- | sys/powerpc/aim/trap_subr64.S | 14 | ||||
-rw-r--r-- | sys/powerpc/include/asm.h | 11 | ||||
-rw-r--r-- | sys/powerpc/include/profile.h | 13 | ||||
-rw-r--r-- | sys/sys/cdefs.h | 11 |
19 files changed, 65 insertions, 79 deletions
diff --git a/contrib/gcc/config/rs6000/freebsd.h b/contrib/gcc/config/rs6000/freebsd.h index ca06d20..52b013e 100644 --- a/contrib/gcc/config/rs6000/freebsd.h +++ b/contrib/gcc/config/rs6000/freebsd.h @@ -37,6 +37,13 @@ #undef TARGET_AIX #define TARGET_AIX TARGET_64BIT +#ifdef HAVE_LD_NO_DOT_SYMS +/* New ABI uses a local sym for the function entry point. */ +extern int dot_symbols; +#undef DOT_SYMBOLS +#define DOT_SYMBOLS dot_symbols +#endif + #undef FBSD_TARGET_CPU_CPP_BUILTINS #define FBSD_TARGET_CPU_CPP_BUILTINS() \ do \ @@ -196,7 +203,7 @@ #ifdef __powerpc64__ #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \ asm (SECTION_OP "\n" \ -" bl ." #FUNC "\n" \ +" bl " #FUNC "\n" \ " nop\n" \ " .previous"); #endif diff --git a/lib/csu/powerpc64/crti.S b/lib/csu/powerpc64/crti.S index 16a22c2..767d920 100644 --- a/lib/csu/powerpc64/crti.S +++ b/lib/csu/powerpc64/crti.S @@ -32,13 +32,12 @@ __FBSDID("$FreeBSD$"); .section ".opd","aw" .align 3 _init: - .quad ._init,.TOC.@tocbase,0 + .quad .L._init,.TOC.@tocbase,0 .previous + .type _init,@function .align 4 - .global ._init - .type ._init,@function -._init: +.L._init: stdu 1,-48(1) mflr 0 std 0,64(1) @@ -49,13 +48,12 @@ _init: .section ".opd","aw" .align 3 _fini: - .quad ._fini,.TOC.@tocbase,0 + .quad .L._fini,.TOC.@tocbase,0 .previous + .type _fini,@function .align 4 - .global ._fini - .type ._fini,@function -._fini: +.L._fini: stdu 1,-48(1) mflr 0 std 0,64(1) diff --git a/lib/libc/gen/_thread_init.c b/lib/libc/gen/_thread_init.c index 0c16d8f..c0b6ade 100644 --- a/lib/libc/gen/_thread_init.c +++ b/lib/libc/gen/_thread_init.c @@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$"); void _thread_init_stub(void); __weak_reference(_thread_init_stub, _thread_init); -__weak_reference_data(_thread_autoinit_dummy_decl_stub, +__weak_reference(_thread_autoinit_dummy_decl_stub, _thread_autoinit_dummy_decl); int _thread_autoinit_dummy_decl_stub = 0; diff --git a/lib/libc/powerpc64/SYS.h b/lib/libc/powerpc64/SYS.h index 7816825..a361767 100644 --- a/lib/libc/powerpc64/SYS.h +++ b/lib/libc/powerpc64/SYS.h @@ -45,7 +45,7 @@ 2: mflr %r0; \ std %r0,16(%r1); \ stdu %r1,-48(%r1); \ - bl PIC_PLT(CNAME(HIDENAME(cerror))); \ + bl CNAME(HIDENAME(cerror)); \ nop; \ addi %r1,%r1,48; \ ld %r0,16(%r1); \ @@ -56,10 +56,6 @@ ENTRY(__CONCAT(__sys_,x)); \ .set CNAME(x),CNAME(__CONCAT(__sys_,x)); \ .weak CNAME(__CONCAT(_,x)); \ .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(.,x)); \ - .set CNAME(__CONCAT(.,x)),CNAME(__CONCAT(.__sys_,x));\ - .weak CNAME(__CONCAT(._,x)); \ - .set CNAME(__CONCAT(._,x)),CNAME(__CONCAT(.__sys_,x));\ _SYSCALL(x); \ bso 2b @@ -69,14 +65,12 @@ ENTRY(__CONCAT(__sys_,x)); \ ENTRY(__CONCAT(__sys_,x)); \ .weak CNAME(__CONCAT(_,x)); \ .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(._,x)); \ - .set CNAME(__CONCAT(._,x)),CNAME(__CONCAT(.__sys_,x));\ _SYSCALL(x); \ bnslr; \ mflr %r0; \ std %r0,16(%r1); \ stdu %r1,-48(%r1); \ - bl PIC_PLT(CNAME(HIDENAME(cerror))); \ + bl CNAME(HIDENAME(cerror)); \ nop; \ addi %r1,%r1,48; \ ld %r0,16(%r1); \ @@ -91,17 +85,13 @@ ENTRY(__CONCAT(__sys_,x)); \ .set CNAME(x),CNAME(__CONCAT(__sys_,x)); \ .weak CNAME(__CONCAT(_,x)); \ .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ - .weak CNAME(__CONCAT(.,x)); \ - .set CNAME(__CONCAT(.,x)),CNAME(__CONCAT(.__sys_,x));\ - .weak CNAME(__CONCAT(._,x)); \ - .set CNAME(__CONCAT(._,x)),CNAME(__CONCAT(.__sys_,x));\ _SYSCALL(x); \ bnslr; \ \ mflr %r0; \ std %r0,16(%r1); \ stdu %r1,-48(%r1); \ - bl PIC_PLT(CNAME(HIDENAME(cerror))); \ + bl CNAME(HIDENAME(cerror)); \ nop; \ addi %r1,%r1,48; \ ld %r0,16(%r1); \ diff --git a/lib/libc/powerpc64/gen/_ctx_start.S b/lib/libc/powerpc64/gen/_ctx_start.S index 6e373c8..79df041 100644 --- a/lib/libc/powerpc64/gen/_ctx_start.S +++ b/lib/libc/powerpc64/gen/_ctx_start.S @@ -38,12 +38,13 @@ blrl /* branch to start function */ mr %r3,%r15 /* pass pointer to ucontext as argument */ nop - bl PIC_PLT(CNAME(_ctx_done)) /* branch to ctxt completion func */ + bl CNAME(_ctx_done) /* branch to ctxt completion func */ /* * we should never return from the * above branch. */ nop - bl PIC_PLT(CNAME(abort)) /* abort */ + bl CNAME(abort) /* abort */ + nop .section .note.GNU-stack,"",%progbits diff --git a/lib/libc/powerpc64/sys/brk.S b/lib/libc/powerpc64/sys/brk.S index 1e71663..675b400 100644 --- a/lib/libc/powerpc64/sys/brk.S +++ b/lib/libc/powerpc64/sys/brk.S @@ -63,7 +63,7 @@ ENTRY(brk) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) - bl PIC_PLT(HIDENAME(cerror)) + bl HIDENAME(cerror) nop ld %r1,0(%r1) ld %r0,16(%r1) diff --git a/lib/libc/powerpc64/sys/cerror.S b/lib/libc/powerpc64/sys/cerror.S index db7a10f..9bf33bf 100644 --- a/lib/libc/powerpc64/sys/cerror.S +++ b/lib/libc/powerpc64/sys/cerror.S @@ -45,7 +45,7 @@ ENTRY(HIDENAME(cerror)) std %r31,48(%r1) mr %r31,%r3 /* stash errval in callee-saved register */ - bl PIC_PLT(CNAME(__error)) + bl CNAME(__error) nop stw %r31,0(%r3) /* store errval into &errno */ diff --git a/lib/libc/powerpc64/sys/exect.S b/lib/libc/powerpc64/sys/exect.S index b752fb8..aa34b9e 100644 --- a/lib/libc/powerpc64/sys/exect.S +++ b/lib/libc/powerpc64/sys/exect.S @@ -39,7 +39,7 @@ ENTRY(exect) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) - bl PIC_PLT(HIDENAME(cerror)) + bl HIDENAME(cerror) nop ld %r1,0(%r1) ld %r0,16(%r1) diff --git a/lib/libc/powerpc64/sys/pipe.S b/lib/libc/powerpc64/sys/pipe.S index 0a92df5..efd3dd6 100644 --- a/lib/libc/powerpc64/sys/pipe.S +++ b/lib/libc/powerpc64/sys/pipe.S @@ -43,7 +43,7 @@ ENTRY(pipe) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) - bl PIC_PLT(HIDENAME(cerror)) + bl HIDENAME(cerror) nop ld %r1,0(%r1) ld %r0,16(%r1) diff --git a/lib/libc/powerpc64/sys/ptrace.S b/lib/libc/powerpc64/sys/ptrace.S index bda17e8..ede00e7 100644 --- a/lib/libc/powerpc64/sys/ptrace.S +++ b/lib/libc/powerpc64/sys/ptrace.S @@ -39,7 +39,7 @@ ENTRY(ptrace) std %r5,56(%r1) stw %r6,64(%r1) - bl PIC_PLT(CNAME(__error)) + bl CNAME(__error) nop li %r7,0 stw %r7,0(%r3) @@ -57,7 +57,7 @@ ENTRY(ptrace) blr 1: stdu %r1,-48(%r1) /* lr already saved */ - bl PIC_PLT(HIDENAME(cerror)) + bl HIDENAME(cerror) nop ld %r1,0(%r1) ld %r0,16(%r1) diff --git a/lib/libc/powerpc64/sys/sbrk.S b/lib/libc/powerpc64/sys/sbrk.S index c767049..e147493 100644 --- a/lib/libc/powerpc64/sys/sbrk.S +++ b/lib/libc/powerpc64/sys/sbrk.S @@ -58,7 +58,7 @@ ENTRY(sbrk) mflr %r0 std %r0,16(%r1) stdu %r1,-48(%r1) - bl PIC_PLT(HIDENAME(cerror)) + bl HIDENAME(cerror) nop ld %r1,0(%r1) ld %r0,16(%r1) diff --git a/libexec/rtld-elf/powerpc64/rtld_start.S b/libexec/rtld-elf/powerpc64/rtld_start.S index 0694de1..186e16e 100644 --- a/libexec/rtld-elf/powerpc64/rtld_start.S +++ b/libexec/rtld-elf/powerpc64/rtld_start.S @@ -65,7 +65,7 @@ _ENTRY(_rtld_start) ld %r4,-0x8000(%r2) /* First TOC entry is TOC base */ subf %r4,%r4,%r2 /* Subtract from real TOC base to get base */ - bl .reloc_non_plt_self /* reloc_non_plt_self(&_DYNAMIC,base) */ + bl reloc_non_plt_self /* reloc_non_plt_self(&_DYNAMIC,base) */ nop /* @@ -80,7 +80,7 @@ _ENTRY(_rtld_start) addi %r4,%r1,128 /* &exit_proc on stack */ addi %r5,%r1,120 /* &obj_main on stack */ - bl ._rtld /* &_start = _rtld(sp, &exit_proc, &obj_main)*/ + bl _rtld /* &_start = _rtld(sp, &exit_proc, &obj_main)*/ nop ld %r2,8(%r3) ld %r11,16(%r3) @@ -133,7 +133,7 @@ _ENTRY(_rtld_bind_start) ld %r3,0(%r11) ld %r4,8(%r11) - bl ._rtld_bind # target addr = _rtld_bind(obj, reloff) + bl _rtld_bind # target addr = _rtld_bind(obj, reloff) nop ld %r2,8(%r3) diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk index 8d01660..01b1438 100644 --- a/sys/conf/kern.mk +++ b/sys/conf/kern.mk @@ -82,6 +82,13 @@ INLINE_LIMIT?= 15000 .endif # +# Use dot symbols on powerpc64 to make ddb happy +# +.if ${MACHINE_ARCH} == "powerpc64" +CFLAGS+= -mcall-aixdesc +.endif + +# # For MIPS we also tell gcc to use floating point emulation # .if ${MACHINE_CPUARCH} == "mips" diff --git a/sys/powerpc/aim/locore64.S b/sys/powerpc/aim/locore64.S index 234cded..acdc8a1 100644 --- a/sys/powerpc/aim/locore64.S +++ b/sys/powerpc/aim/locore64.S @@ -174,7 +174,7 @@ ASENTRY(__start) insrdi 9,8,1,0 mtmsrd 9 - bl .OF_initial_setup + bl OF_initial_setup nop lis 4,end@ha @@ -188,14 +188,14 @@ ASENTRY(__start) mr 6,20 mr 7,21 - bl .powerpc_init + bl powerpc_init nop mr %r1, %r3 li %r3, 0 std %r3, 0(%r1) - bl .mi_startup + bl mi_startup nop - b .OF_exit + b OF_exit nop /* diff --git a/sys/powerpc/aim/swtch64.S b/sys/powerpc/aim/swtch64.S index dd76e0a..1877e8d 100644 --- a/sys/powerpc/aim/swtch64.S +++ b/sys/powerpc/aim/swtch64.S @@ -121,7 +121,7 @@ ENTRY(cpu_switch) /* Save FPU context if needed */ andi. %r7, %r7, PCB_FPU beq .L1 - bl .save_fpu + bl save_fpu nop .L1: @@ -130,12 +130,12 @@ ENTRY(cpu_switch) /* Save Altivec context if needed */ andi. %r7, %r7, PCB_VEC beq .L2 - bl .save_vec + bl save_vec nop .L2: mr %r3,%r14 /* restore old thread ptr */ - bl .pmap_deactivate /* Deactivate the current pmap */ + bl pmap_deactivate /* Deactivate the current pmap */ nop addi %r1,%r1,48 @@ -161,7 +161,7 @@ blocked_loop: stdu %r1,-48(%r1) mr %r3,%r15 /* Get new thread ptr */ - bl .pmap_activate /* Activate the new address space */ + bl pmap_activate /* Activate the new address space */ nop lwz %r6, PCB_FLAGS(%r17) @@ -169,7 +169,7 @@ blocked_loop: andi. %r6, %r6, PCB_FPU beq .L3 mr %r3,%r15 /* Pass curthread to enable_fpu */ - bl .enable_fpu + bl enable_fpu nop .L3: @@ -178,7 +178,7 @@ blocked_loop: andi. %r6, %r6, PCB_VEC beq .L4 mr %r3,%r15 /* Pass curthread to enable_vec */ - bl .enable_vec + bl enable_vec nop /* thread to restore is in r3 */ @@ -276,7 +276,7 @@ ENTRY(fork_trampoline) ld %r5,CF_ARG1(%r1) stdu %r1,-48(%r1) - bl .fork_exit + bl fork_exit nop addi %r1,%r1,48+CF_SIZE-FSP /* Allow 8 bytes in front of trapframe to simulate FRAME_SETUP diff --git a/sys/powerpc/aim/trap_subr64.S b/sys/powerpc/aim/trap_subr64.S index db54d4b..64e4ac1 100644 --- a/sys/powerpc/aim/trap_subr64.S +++ b/sys/powerpc/aim/trap_subr64.S @@ -295,14 +295,14 @@ cpu_reset: lis %r3,tocbase@ha ld %r2,tocbase@l(%r3) lis %r3,1@l - bl CNAME(.cpudep_ap_early_bootstrap) /* Set PCPU */ + bl CNAME(cpudep_ap_early_bootstrap) /* Set PCPU */ nop - bl CNAME(.pmap_cpu_bootstrap) /* Turn on virtual memory */ + bl CNAME(pmap_cpu_bootstrap) /* Turn on virtual memory */ nop - bl CNAME(.cpudep_ap_bootstrap) /* Set up PCPU and stack */ + bl CNAME(cpudep_ap_bootstrap) /* Set up PCPU and stack */ nop mr %r1,%r3 /* Use new stack */ - bl CNAME(.machdep_ap_bootstrap) /* And away! */ + bl CNAME(machdep_ap_bootstrap) /* And away! */ nop /* Should not be reached */ @@ -510,7 +510,7 @@ trapagain: lis %r3,tocbase@ha ld %r2,tocbase@l(%r3) addi %r3,%r1,48 - bl CNAME(.powerpc_interrupt) + bl CNAME(powerpc_interrupt) nop .globl CNAME(trapexit) /* backtrace code sentinel */ @@ -538,7 +538,7 @@ CNAME(trapexit): lis %r3,tocbase@ha ld %r2,tocbase@l(%r3) addi %r3,%r1,48 - bl CNAME(.ast) + bl CNAME(ast) nop .globl CNAME(asttrapexit) /* backtrace code sentinel #2 */ CNAME(asttrapexit): @@ -587,7 +587,7 @@ dbtrap: lis %r3,tocbase@ha ld %r2,tocbase@l(%r3) addi %r3,%r1,48 - bl CNAME(.db_trap_glue) + bl CNAME(db_trap_glue) nop or. %r3,%r3,%r3 bne dbleave diff --git a/sys/powerpc/include/asm.h b/sys/powerpc/include/asm.h index 90c30cb..0c6b6a5 100644 --- a/sys/powerpc/include/asm.h +++ b/sys/powerpc/include/asm.h @@ -37,7 +37,7 @@ #include <sys/cdefs.h> -#ifdef PIC +#if defined(PIC) && !defined(__powerpc64__) #define PIC_PROLOGUE XXX #define PIC_EPILOGUE XXX #define PIC_PLT(x) x@plt @@ -53,11 +53,6 @@ #define PIC_GOT(x) x #endif -#ifdef __powerpc64__ -#undef PIC_PLT -#define PIC_PLT(x) __CONCAT(.,x) -#endif - #define CNAME(csym) csym #define ASMNAME(asmsym) asmsym #ifdef __powerpc64__ @@ -73,8 +68,8 @@ #define _ENTRY(x) \ .text; .align 2; .globl x; .section ".opd","aw"; \ .align 3; x: \ - .quad .x,.TOC.@tocbase,0; .previous; \ - .align 4; .globl .x; .type .x,@function; .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: diff --git a/sys/powerpc/include/profile.h b/sys/powerpc/include/profile.h index 6c8185a..a354e38 100644 --- a/sys/powerpc/include/profile.h +++ b/sys/powerpc/include/profile.h @@ -83,13 +83,12 @@ __asm( " .text \n" \ " .section \".opd\",\"aw\" \n" \ " .align 3 \n" \ "_mcount: \n" \ - " .quad ._mcount,.TOC.@tocbase,0 \n" \ + " .quad .L._mcount,.TOC.@tocbase,0\n" \ " .previous \n" \ + " .type _mcount,@function \n" \ " .align 4 \n" \ - " .globl ._mcount \n" \ - " .type ._mcount,@function \n" \ - "._mcount: \n" \ - " stdu %r1,-(288+120)(%r1) \n" \ + ".L._mcount: \n" \ + " stdu %r1,-(288+128)(%r1) \n" \ " std %r3,48(%r1) \n" \ " std %r4,56(%r1) \n" \ " std %r5,64(%r1) \n" \ @@ -103,7 +102,7 @@ __asm( " .text \n" \ " ld %r3,0(%r1) \n" \ " ld %r3,0(%r3) \n" \ " ld %r3,16(%r3) \n" \ - " bl .__mcount \n" \ + " bl __mcount \n" \ " nop \n" \ " ld %r4,112(%r1) \n" \ " mtlr %r4 \n" \ @@ -115,7 +114,7 @@ __asm( " .text \n" \ " ld %r8,88(%r1) \n" \ " ld %r9,96(%r1) \n" \ " ld %r10,104(%r1) \n" \ - " addi %r1,%r1,(288+120) \n" \ + " addi %r1,%r1,(288+128) \n" \ " blr \n"); #else diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index d1d4837..dbab329 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -362,19 +362,8 @@ extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym))) #endif #ifdef __STDC__ -#ifdef __powerpc64__ #define __weak_reference(sym,alias) \ __asm__(".weak " #alias); \ - __asm__(".equ " #alias ", " #sym); \ - __asm__(".weak ." #alias); \ - __asm__(".equ ." #alias ", ." #sym) -#else -#define __weak_reference(sym,alias) \ - __asm__(".weak " #alias); \ - __asm__(".equ " #alias ", " #sym) -#endif -#define __weak_reference_data(sym,alias)\ - __asm__(".weak " #alias); \ __asm__(".equ " #alias ", " #sym) #define __warn_references(sym,msg) \ __asm__(".section .gnu.warning." #sym); \ |