summaryrefslogtreecommitdiffstats
path: root/libc/sysdeps/linux/powerpc
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2005-07-25 02:29:20 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2005-07-25 02:29:20 +0000
commitff45f14ea255d442f779157db133d73777675a5c (patch)
treeeafe5f8052f5e3fb0f50c48d3b8fdd371445c302 /libc/sysdeps/linux/powerpc
parent1d2230a7d275706c5f0de850e15527aae3744310 (diff)
downloaduClibc-alpine-ff45f14ea255d442f779157db133d73777675a5c.tar.bz2
uClibc-alpine-ff45f14ea255d442f779157db133d73777675a5c.tar.xz
A merging we will go. A merging we will go. Hi ho the merrio' a merging we will go.
Diffstat (limited to 'libc/sysdeps/linux/powerpc')
-rw-r--r--libc/sysdeps/linux/powerpc/Makefile21
-rw-r--r--libc/sysdeps/linux/powerpc/__syscall_error.c8
-rw-r--r--libc/sysdeps/linux/powerpc/__uClibc_syscall.S10
-rw-r--r--libc/sysdeps/linux/powerpc/bits/syscalls.h5
-rw-r--r--libc/sysdeps/linux/powerpc/brk.S20
-rw-r--r--libc/sysdeps/linux/powerpc/clone.S23
-rw-r--r--libc/sysdeps/linux/powerpc/crt0.S103
-rw-r--r--libc/sysdeps/linux/powerpc/syscall.S19
8 files changed, 40 insertions, 169 deletions
diff --git a/libc/sysdeps/linux/powerpc/Makefile b/libc/sysdeps/linux/powerpc/Makefile
index 25cb7047d..eb212bac0 100644
--- a/libc/sysdeps/linux/powerpc/Makefile
+++ b/libc/sysdeps/linux/powerpc/Makefile
@@ -19,10 +19,9 @@
TOPDIR=../../../../
include $(TOPDIR)Rules.mak
-CRT0_SRC = crt0.S
-CRT0_OBJ = crt0.o crt1.o
-SCRT0_OBJ = $(patsubst %,S%, $(CRT0_OBJ))
-CRT0_DEPS=gmon-start.S
+CRT_SRC = crt1.S
+CRT_OBJ = crt1.o
+SCRT_OBJ = $(patsubst %,S%, $(CRT_OBJ))
CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o
SSRC=__longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S brk.S \
@@ -38,21 +37,16 @@ OBJ_LIST=../../../obj.sysdeps.$(TARGET_ARCH)
all: $(OBJ_LIST)
-$(OBJ_LIST): $(OBJS) $(CRT0_OBJ) $(SCRT0_OBJ) $(CTOR_TARGETS)
+$(OBJ_LIST): $(OBJS) $(CRT_OBJ) $(SCRT_OBJ) $(CTOR_TARGETS)
echo $(patsubst %, sysdeps/linux/$(TARGET_ARCH)/%, $(OBJS)) > $(OBJ_LIST)
$(INSTALL) -d $(TOPDIR)lib/
- cp $(CRT0_OBJ) $(SCRT0_OBJ) $(TOPDIR)lib/
-ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y)
- $(RM) $(TOPDIR)lib/Scrt0.o
-else
- mv $(TOPDIR)lib/Scrt0.o $(TOPDIR)lib/Scrt1.o
-endif
+ cp $(CRT_OBJ) $(SCRT_OBJ) $(TOPDIR)lib/
-$(CRT0_OBJ): $(CRT0_SRC)
+$(CRT_OBJ): $(CRT_SRC)
$(CC) $(ASFLAGS) -DL_$* $< -c -o $*.o
$(STRIPTOOL) -x -R .note -R .comment $*.o
-$(SCRT0_OBJ): $(CRT0_SRC)
+$(SCRT_OBJ): $(CRT_SRC)
$(CC) $(ASFLAGS) $(PIEFLAG) -DL_$* $< -c -o $*.o
$(STRIPTOOL) -x -R .note -R .comment $*.o
@@ -94,4 +88,3 @@ headers:
clean:
$(RM) *.[oa] *~ core
$(RM) bits/sysnum.h
- $(RM) gmon-start.S
diff --git a/libc/sysdeps/linux/powerpc/__syscall_error.c b/libc/sysdeps/linux/powerpc/__syscall_error.c
index 9ab65ed79..de65a1f39 100644
--- a/libc/sysdeps/linux/powerpc/__syscall_error.c
+++ b/libc/sysdeps/linux/powerpc/__syscall_error.c
@@ -1,4 +1,4 @@
-/* Wrapper around clone system call.
+/* Wrapper for setting errno.
Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -18,12 +18,12 @@
02111-1307 USA. */
#include <errno.h>
+#include <features.h>
/* This routine is jumped to by all the syscall handlers, to stash
* an error number into errno. */
-int __syscall_error (int err_no)
+int attribute_hidden __syscall_error(int err_no)
{
- __set_errno (err_no);
+ __set_errno(err_no);
return -1;
}
-
diff --git a/libc/sysdeps/linux/powerpc/__uClibc_syscall.S b/libc/sysdeps/linux/powerpc/__uClibc_syscall.S
index 09bfb89cc..5a14c948c 100644
--- a/libc/sysdeps/linux/powerpc/__uClibc_syscall.S
+++ b/libc/sysdeps/linux/powerpc/__uClibc_syscall.S
@@ -1,14 +1,12 @@
-.section ".text"
+ .text
.align 2
-.globl __uClibc_syscall
+ .globl __uClibc_syscall
.type __uClibc_syscall,@function
__uClibc_syscall:
.Lsize:
sc
bnslr
-#ifdef __PIC__
- b __syscall_error@plt
-#else
+
b __syscall_error
-#endif
+
.size __uClibc_syscall,.Lsize-__uClibc_syscall
diff --git a/libc/sysdeps/linux/powerpc/bits/syscalls.h b/libc/sysdeps/linux/powerpc/bits/syscalls.h
index ac7395097..6168f3906 100644
--- a/libc/sysdeps/linux/powerpc/bits/syscalls.h
+++ b/libc/sysdeps/linux/powerpc/bits/syscalls.h
@@ -27,10 +27,9 @@
".align 2\n\t" \
".globl " __STRINGIFY(name) "\n\t" \
".type " __STRINGIFY(name) ",@function\n\t" \
- #name":\n\tli 0," __STRINGIFY(__NR_##name) "\n\t" \
+ #name":\tli 0," __STRINGIFY(__NR_##name) "\n\t" \
"b " __MAKE_SYSCALL "\n\t" \
- ".Lfe1" __STRINGIFY(name) ":\n\t" \
- ".size\t" __STRINGIFY(name) ",.Lfe1" __STRINGIFY(name) "-" __STRINGIFY(name) "\n" \
+ ".size\t" __STRINGIFY(name) ",.""-" __STRINGIFY(name) "\n" \
)
#undef _syscall0
diff --git a/libc/sysdeps/linux/powerpc/brk.S b/libc/sysdeps/linux/powerpc/brk.S
index b914ce814..c0b436d96 100644
--- a/libc/sysdeps/linux/powerpc/brk.S
+++ b/libc/sysdeps/linux/powerpc/brk.S
@@ -24,10 +24,10 @@
#ifdef __NR_brk
.comm __curbrk,4,4
- .section ".text"
-.globl __brk;
-.type __brk, @function;
-.align 2;
+ .text
+ .globl __brk
+ .type __brk,@function
+ .align 2
__brk:
stwu r1,-16(r1)
@@ -51,13 +51,11 @@ __brk:
li r3,0
blelr+
li r3,ENOMEM
-#ifdef __PIC__
- b __syscall_error@plt
-#else
+
b __syscall_error
-#endif
-.size __brk,.-__brk
-.weak brk;
-brk=__brk
+ .size __brk,.-__brk
+
+ .weak brk
+ brk=__brk
#endif
diff --git a/libc/sysdeps/linux/powerpc/clone.S b/libc/sysdeps/linux/powerpc/clone.S
index edce8d569..f7c6bd18e 100644
--- a/libc/sysdeps/linux/powerpc/clone.S
+++ b/libc/sysdeps/linux/powerpc/clone.S
@@ -30,10 +30,9 @@
int flags [r5], void *arg [r6]); */
#ifdef __NR_clone
-.globl __clone;
-.type __clone, @function;
-.align 2;
-
+ .globl __clone
+ .type __clone,@function
+ .align 2
__clone:
/* Check for child_stack == NULL || fn == NULL. */
@@ -90,21 +89,15 @@ __clone:
lmw r29,16(r1)
addi r1,r1,32
bnslr+
-#ifdef __PIC__
- b __syscall_error@plt
-#else
+
b __syscall_error
-#endif
.Lbadargs:
li r3,EINVAL
-#ifdef __PIC__
- b __syscall_error@plt
-#else
+
b __syscall_error
-#endif
-.size __clone,.-__clone
-.weak clone;
-clone=__clone
+ .size __clone,.-__clone
+ .weak clone
+ clone=__clone
#endif
diff --git a/libc/sysdeps/linux/powerpc/crt0.S b/libc/sysdeps/linux/powerpc/crt0.S
deleted file mode 100644
index d2808a7c1..000000000
--- a/libc/sysdeps/linux/powerpc/crt0.S
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (C) 2003 by Erik Andersen
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* Integer registers. */
-#define r0 0
-#define r1 1
-#define r2 2
-#define r3 3
-#define r4 4
-#define r5 5
-#define r6 6
-#define r7 7
-#define r8 8
-#define r9 9
-#define r13 13
-#define r31 31
-
-#include <features.h>
-
- .section ".text"
- .globl _start
- .type _start,@function
-#if defined L_crt0 || defined L_Scrt0 || ! defined __UCLIBC_CTOR_DTOR__
- .type __uClibc_main,%function
-#else
- .weak _init
- .weak _fini
- .type __uClibc_start_main,%function
-#endif
-/* Stick in a dummy reference to main(), so that if an application
- * is linking when the main() function is in a static library (.a)
- * we can be sure that main() actually gets linked in */
- .type main,%function
-
-_start:
- /* Save the stack pointer, in case we're statically linked under Linux. */
- mr r9,r1
-#if defined L_Scrt0 || defined L_Scrt1
- bl _GLOBAL_OFFSET_TABLE_-4@local
- mflr r31
-#endif
- /* Set up an initial stack frame, and clear the LR. */
- clrrwi r1,r1,4
- li r0,0
- stwu r1,-16(r1)
- mtlr r0
- stw r0,0(r1)
-
- /* find argc from the stack pointer */
- lwz r3,0(r9)
- /* find argv one word offset from the stack pointer */
- addi r4,r9,4
- /* find environment pointer (argv+argc+1) */
- lwz r5,0(r9)
- addi r5,r5,1
- rlwinm r5,r5,2,0,29
- add r5,r5,r4
- mr r8,r7 /* Pass _dl_fini from ldso */
- /* Ok, now run uClibc's main() -- shouldn't return */
-#if (defined L_crt1 || defined L_Scrt1) && defined __UCLIBC_CTOR_DTOR__
-# ifdef L_Scrt1
- lwz r6,_init@got(r31)
- lwz r7,_fini@got(r31)
- b __uClibc_start_main@plt
-# else
- lis r6,_init@ha # load top 16 bits
- addi r6,r6,_init@l # load bottom 16 bits
- lis r7,_fini@ha # load top 16 bits of &msg
- addi r7,r7,_fini@l # load bottom 16 bits
- b __uClibc_start_main
-# endif
-#else
-# ifdef L_Scrt0
- b __uClibc_main@plt
-# else
- b __uClibc_main
-# endif
-#endif
-.size _start,.-_start
-
-/* Define a symbol for the first piece of initialized data. */
- .data
- .globl __data_start
-__data_start:
- .long 0
- .weak data_start
- data_start = __data_start
-
diff --git a/libc/sysdeps/linux/powerpc/syscall.S b/libc/sysdeps/linux/powerpc/syscall.S
index 71f711931..b85398416 100644
--- a/libc/sysdeps/linux/powerpc/syscall.S
+++ b/libc/sysdeps/linux/powerpc/syscall.S
@@ -18,14 +18,10 @@
#include <features.h>
- .section ".text"
- .globl syscall;
- .type syscall,@function;
- .align 2;
-
-.globl syscall;
-.type syscall,@function;
-.align 2;
+ .text
+ .globl syscall
+ .type syscall,@function
+ .align 2
syscall:
mr 0,3
@@ -36,10 +32,7 @@ syscall:
mr 7,8
sc
bnslr;
-#ifdef __PIC__
- b __syscall_error@plt
-#else
+
b __syscall_error
-#endif
-.size syscall,.-syscall
+ .size syscall,.-syscall