From 233c504cd940d9802226b6a3a092368b86978f5e Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 4 May 2011 10:01:24 +0200 Subject: */crt?.S: remove .size directives sed -i -e '/\.size[[:space:]]/d' $(grep -l "\.size" libc/sysdeps/linux/*/crt*.[sSc]) Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/arm/crti.S | 1 - libc/sysdeps/linux/arm/crtn.S | 2 -- libc/sysdeps/linux/avr32/crt1.S | 1 - libc/sysdeps/linux/avr32/crtn.S | 2 -- libc/sysdeps/linux/cris/crt1.S | 2 -- libc/sysdeps/linux/cris/crtn.S | 2 -- libc/sysdeps/linux/frv/crt0.S | 1 - libc/sysdeps/linux/frv/crtn.S | 2 -- libc/sysdeps/linux/h8300/crtn.S | 2 -- libc/sysdeps/linux/i386/crt1.S | 1 - libc/sysdeps/linux/i386/crtn.S | 2 -- libc/sysdeps/linux/microblaze/crtn.S | 2 -- libc/sysdeps/linux/mips/crt1.S | 1 - libc/sysdeps/linux/powerpc/crt1.S | 1 - libc/sysdeps/linux/powerpc/crtn.S | 2 -- libc/sysdeps/linux/sh/crt1.S | 1 - libc/sysdeps/linux/sh/crtn.S | 2 -- libc/sysdeps/linux/sh64/crtn.S | 2 -- libc/sysdeps/linux/sparc/crt1.S | 1 - libc/sysdeps/linux/sparc/crtn.S | 2 -- libc/sysdeps/linux/v850/crtn.S | 2 -- libc/sysdeps/linux/vax/crtn.S | 2 -- libc/sysdeps/linux/x86_64/crt1.S | 1 - libc/sysdeps/linux/x86_64/crtn.S | 2 -- 24 files changed, 39 deletions(-) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/arm/crti.S b/libc/sysdeps/linux/arm/crti.S index e335b7140..a2d0c03f2 100644 --- a/libc/sysdeps/linux/arm/crti.S +++ b/libc/sysdeps/linux/arm/crti.S @@ -63,7 +63,6 @@ _fini: _call_via_\register: bx \register nop - .size _call_via_\register, . - _call_via_\register .endm @ and calls for the 15 general purpose registers (2 bytes each). diff --git a/libc/sysdeps/linux/arm/crtn.S b/libc/sysdeps/linux/arm/crtn.S index de01b38dc..a4752c186 100644 --- a/libc/sysdeps/linux/arm/crtn.S +++ b/libc/sysdeps/linux/arm/crtn.S @@ -15,7 +15,6 @@ .arm ldmdb fp, {r4, r5, r6, r7, r8, r9, sl, fp, sp, pc} #endif - .size _init, .-_init .section .fini .global _fini @@ -29,7 +28,6 @@ .arm ldmdb fp, {r4, r5, r6, r7, r8, r9, sl, fp, sp, pc} #endif - .size _fini, .-_fini @ In fact this is modified to 3.4.4 .ident "GCC: (GNU) 3.3.2 20031005 (Debian prerelease)" diff --git a/libc/sysdeps/linux/avr32/crt1.S b/libc/sysdeps/linux/avr32/crt1.S index ca1fa7a4c..e2a82a528 100644 --- a/libc/sysdeps/linux/avr32/crt1.S +++ b/libc/sysdeps/linux/avr32/crt1.S @@ -80,7 +80,6 @@ __main_addr: ___uClibc_main_addr: .long __uClibc_main #endif - .size _start, . - _start /* * The LSB says we need this. diff --git a/libc/sysdeps/linux/avr32/crtn.S b/libc/sysdeps/linux/avr32/crtn.S index f7d104070..c37f7d201 100644 --- a/libc/sysdeps/linux/avr32/crtn.S +++ b/libc/sysdeps/linux/avr32/crtn.S @@ -4,11 +4,9 @@ .global _init .type _init, @function ldm sp++, r6, pc - .size _init, . - _init .section .fini .align 2 .global _fini .type _fini, @function ldm sp++, r6, pc - .size _fini, . - _fini diff --git a/libc/sysdeps/linux/cris/crt1.S b/libc/sysdeps/linux/cris/crt1.S index b07e36b51..1525a2b76 100644 --- a/libc/sysdeps/linux/cris/crt1.S +++ b/libc/sysdeps/linux/cris/crt1.S @@ -9,7 +9,6 @@ .global __data_start .align 2 .type __data_start, @object - .size __data_start, 4 __data_start: .dword 0 @@ -53,4 +52,3 @@ _start: /* Leave control to the libc */ jsr __uClibc_main nop - .size _start, .-_start diff --git a/libc/sysdeps/linux/cris/crtn.S b/libc/sysdeps/linux/cris/crtn.S index 951ae5449..7b2dce17c 100644 --- a/libc/sysdeps/linux/cris/crtn.S +++ b/libc/sysdeps/linux/cris/crtn.S @@ -9,7 +9,6 @@ move.d [$sp+],$r1 Ret nop - .size _init, .-_init .section .fini .align 1 @@ -20,4 +19,3 @@ move.d [$sp+],$r1 Ret nop - .size _fini, .-_fini diff --git a/libc/sysdeps/linux/frv/crt0.S b/libc/sysdeps/linux/frv/crt0.S index a1d07bb69..a40b67e80 100644 --- a/libc/sysdeps/linux/frv/crt0.S +++ b/libc/sysdeps/linux/frv/crt0.S @@ -113,7 +113,6 @@ _start: /* Crash if somehow `exit' returns anyways. */ jmpl @(gr0,gr0) -.size _start,.-_start /* Define a symbol for the first piece of initialized data. */ .data diff --git a/libc/sysdeps/linux/frv/crtn.S b/libc/sysdeps/linux/frv/crtn.S index 1d58c0207..bd11901ad 100644 --- a/libc/sysdeps/linux/frv/crtn.S +++ b/libc/sysdeps/linux/frv/crtn.S @@ -32,7 +32,6 @@ Cambridge, MA 02139, USA. */ ld @(sp,gr0), fp addi sp,#16,sp jmpl @(gr5,gr0) - .size _init, .-_init .section .fini,"x" .globl _fini @@ -41,4 +40,3 @@ Cambridge, MA 02139, USA. */ ld @(sp,gr0), fp addi sp,#16,sp jmpl @(gr5,gr0) - .size _fini, .-_fini diff --git a/libc/sysdeps/linux/h8300/crtn.S b/libc/sysdeps/linux/h8300/crtn.S index 89e321868..8f9fa1fac 100644 --- a/libc/sysdeps/linux/h8300/crtn.S +++ b/libc/sysdeps/linux/h8300/crtn.S @@ -14,7 +14,6 @@ ; #NO_APP mov.l @er7+,er6 rts - .size __init, .-__init ; #APP .section .fini @@ -24,7 +23,6 @@ ; #NO_APP mov.l @er7+,er6 rts - .size __fini, .-__fini ; #APP .end diff --git a/libc/sysdeps/linux/i386/crt1.S b/libc/sysdeps/linux/i386/crt1.S index a133cb9e0..7dfeaf1a5 100644 --- a/libc/sysdeps/linux/i386/crt1.S +++ b/libc/sysdeps/linux/i386/crt1.S @@ -129,7 +129,6 @@ _start: #endif hlt /* Crash if somehow `exit' does return. */ -.size _start,.-_start /* Define a symbol for the first piece of initialized data. */ .data diff --git a/libc/sysdeps/linux/i386/crtn.S b/libc/sysdeps/linux/i386/crtn.S index 191250487..34d5b38e2 100644 --- a/libc/sysdeps/linux/i386/crtn.S +++ b/libc/sysdeps/linux/i386/crtn.S @@ -6,7 +6,6 @@ popl %ebx popl %ebp ret -.size _init,.-_init @@ -16,7 +15,6 @@ popl %ebx popl %ebp ret -.size _fini,.-_fini diff --git a/libc/sysdeps/linux/microblaze/crtn.S b/libc/sysdeps/linux/microblaze/crtn.S index da8c920ef..6f4ef60d3 100644 --- a/libc/sysdeps/linux/microblaze/crtn.S +++ b/libc/sysdeps/linux/microblaze/crtn.S @@ -26,7 +26,6 @@ .end _init $Lfe2: - .size _init,$Lfe2-_init .section .fini .align 2 @@ -40,6 +39,5 @@ $Lfe2: .end _fini $Lfe3: - .size _fini,$Lfe3-_fini /*@TRAILER_BEGINS*/ diff --git a/libc/sysdeps/linux/mips/crt1.S b/libc/sysdeps/linux/mips/crt1.S index 6a804125e..90f69e9c8 100644 --- a/libc/sysdeps/linux/mips/crt1.S +++ b/libc/sysdeps/linux/mips/crt1.S @@ -118,7 +118,6 @@ __start: hlt: /* Crash if somehow `__uClibc_main' returns anyway. */ b hlt -.size __start,.-__start .end __start /* Define a symbol for the first piece of initialized data. */ diff --git a/libc/sysdeps/linux/powerpc/crt1.S b/libc/sysdeps/linux/powerpc/crt1.S index 4f1494a8f..de3aa0814 100644 --- a/libc/sysdeps/linux/powerpc/crt1.S +++ b/libc/sysdeps/linux/powerpc/crt1.S @@ -95,7 +95,6 @@ _start: b __uClibc_main #endif -.size _start,.-_start /* Define a symbol for the first piece of initialized data. */ .data diff --git a/libc/sysdeps/linux/powerpc/crtn.S b/libc/sysdeps/linux/powerpc/crtn.S index ba6d0e0c8..938367caa 100644 --- a/libc/sysdeps/linux/powerpc/crtn.S +++ b/libc/sysdeps/linux/powerpc/crtn.S @@ -9,7 +9,6 @@ addi 1,1,32 mtlr 0 blr - .size _init, .-_init .section .fini .align 2 @@ -20,4 +19,3 @@ addi 1,1,32 mtlr 0 blr - .size _fini, .-_fini diff --git a/libc/sysdeps/linux/sh/crt1.S b/libc/sysdeps/linux/sh/crt1.S index 9707f8316..277c55e69 100644 --- a/libc/sysdeps/linux/sh/crt1.S +++ b/libc/sysdeps/linux/sh/crt1.S @@ -104,7 +104,6 @@ _start: nop #endif - .size _start,.-_start .align 2 #ifdef __PIC__ diff --git a/libc/sysdeps/linux/sh/crtn.S b/libc/sysdeps/linux/sh/crtn.S index 437f8ebc3..e8be7e51f 100644 --- a/libc/sysdeps/linux/sh/crtn.S +++ b/libc/sysdeps/linux/sh/crtn.S @@ -15,7 +15,6 @@ .align 2 .L6: .L7: - .size _init, .-_init .section .fini .hidden _fini @@ -31,6 +30,5 @@ .align 2 .L11: .L12: - .size _fini, .-_fini .ident "GCC: (GNU) 3.3.2" diff --git a/libc/sysdeps/linux/sh64/crtn.S b/libc/sysdeps/linux/sh64/crtn.S index eb6479a56..501fe9167 100644 --- a/libc/sysdeps/linux/sh64/crtn.S +++ b/libc/sysdeps/linux/sh64/crtn.S @@ -14,7 +14,6 @@ ptabs r18, tr0 addi.l r15, 16, r15 blink tr0, r63 - .size _init, .-_init .section .fini .hidden _fini @@ -28,6 +27,5 @@ ptabs r18, tr0 addi.l r15, 16, r15 blink tr0, r63 - .size _fini, .-_fini .ident "GCC: (GNU) 3.3.2" diff --git a/libc/sysdeps/linux/sparc/crt1.S b/libc/sysdeps/linux/sparc/crt1.S index f33a714ef..78aaaccce 100644 --- a/libc/sysdeps/linux/sparc/crt1.S +++ b/libc/sysdeps/linux/sparc/crt1.S @@ -123,7 +123,6 @@ _start: illtrap 0 #endif -.size _start,.-_start /* Define a symbol for the first piece of initialized data. */ .data diff --git a/libc/sysdeps/linux/sparc/crtn.S b/libc/sysdeps/linux/sparc/crtn.S index 24b4bf43c..d64ffd020 100644 --- a/libc/sysdeps/linux/sparc/crtn.S +++ b/libc/sysdeps/linux/sparc/crtn.S @@ -7,7 +7,6 @@ .proc 020 ret restore - .size _init, .-_init .section .fini .align 4 @@ -16,4 +15,3 @@ .proc 020 ret restore - .size _fini, .-_fini diff --git a/libc/sysdeps/linux/v850/crtn.S b/libc/sysdeps/linux/v850/crtn.S index aecb55737..6bb0b39ac 100644 --- a/libc/sysdeps/linux/v850/crtn.S +++ b/libc/sysdeps/linux/v850/crtn.S @@ -8,7 +8,6 @@ .type __init, @function #NO_APP jr __return_r31 - .size __init, .-__init #APP .section .fini @@ -18,7 +17,6 @@ .type __fini, @function #NO_APP jr __return_r31 - .size __fini, .-__fini #APP .ident "GCC: (GNU) 3.3.2" diff --git a/libc/sysdeps/linux/vax/crtn.S b/libc/sysdeps/linux/vax/crtn.S index 6ca5c4fcd..1153fd50b 100644 --- a/libc/sysdeps/linux/vax/crtn.S +++ b/libc/sysdeps/linux/vax/crtn.S @@ -9,7 +9,6 @@ __gnu_compiled_c: .type _init,@function ret .Lfe2: - .size _init,.Lfe2-_init .section .fini .align 1 @@ -17,5 +16,4 @@ __gnu_compiled_c: .type _fini,@function ret .Lfe3: - .size _fini,.Lfe3-_fini .ident "GCC: (GNU) 2.95.2 19991024 (release) (Linux/VAX CVS)" diff --git a/libc/sysdeps/linux/x86_64/crt1.S b/libc/sysdeps/linux/x86_64/crt1.S index f6c1eb1e7..a21be7583 100644 --- a/libc/sysdeps/linux/x86_64/crt1.S +++ b/libc/sysdeps/linux/x86_64/crt1.S @@ -129,7 +129,6 @@ _start: #endif hlt /* Crash if somehow `exit' does return. */ -.size _start,.-_start /* Define a symbol for the first piece of initialized data. */ .data diff --git a/libc/sysdeps/linux/x86_64/crtn.S b/libc/sysdeps/linux/x86_64/crtn.S index 5b110d967..9804e0f76 100644 --- a/libc/sysdeps/linux/x86_64/crtn.S +++ b/libc/sysdeps/linux/x86_64/crtn.S @@ -7,7 +7,6 @@ .type _init, %function addq $8, %rsp ret -.size _init,.-_init .section .fini @@ -15,4 +14,3 @@ .type _fini, %function addq $8, %rsp ret -.size _fini, .-_fini -- cgit v1.2.3 From 07464c3e7156f4c8dfcac673c74f19b700b1b3b5 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Thu, 5 May 2011 09:19:16 +0200 Subject: Revert "*/crt?.S: remove .size directives" Removing them generally was not a good idea This reverts commit 233c504cd940d9802226b6a3a092368b86978f5e. --- libc/sysdeps/linux/arm/crti.S | 1 + libc/sysdeps/linux/arm/crtn.S | 2 ++ libc/sysdeps/linux/avr32/crt1.S | 1 + libc/sysdeps/linux/avr32/crtn.S | 2 ++ libc/sysdeps/linux/cris/crt1.S | 2 ++ libc/sysdeps/linux/cris/crtn.S | 2 ++ libc/sysdeps/linux/frv/crt0.S | 1 + libc/sysdeps/linux/frv/crtn.S | 2 ++ libc/sysdeps/linux/h8300/crtn.S | 2 ++ libc/sysdeps/linux/i386/crt1.S | 1 + libc/sysdeps/linux/i386/crtn.S | 2 ++ libc/sysdeps/linux/microblaze/crtn.S | 2 ++ libc/sysdeps/linux/mips/crt1.S | 1 + libc/sysdeps/linux/powerpc/crt1.S | 1 + libc/sysdeps/linux/powerpc/crtn.S | 2 ++ libc/sysdeps/linux/sh/crt1.S | 1 + libc/sysdeps/linux/sh/crtn.S | 2 ++ libc/sysdeps/linux/sh64/crtn.S | 2 ++ libc/sysdeps/linux/sparc/crt1.S | 1 + libc/sysdeps/linux/sparc/crtn.S | 2 ++ libc/sysdeps/linux/v850/crtn.S | 2 ++ libc/sysdeps/linux/vax/crtn.S | 2 ++ libc/sysdeps/linux/x86_64/crt1.S | 1 + libc/sysdeps/linux/x86_64/crtn.S | 2 ++ 24 files changed, 39 insertions(+) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/arm/crti.S b/libc/sysdeps/linux/arm/crti.S index a2d0c03f2..e335b7140 100644 --- a/libc/sysdeps/linux/arm/crti.S +++ b/libc/sysdeps/linux/arm/crti.S @@ -63,6 +63,7 @@ _fini: _call_via_\register: bx \register nop + .size _call_via_\register, . - _call_via_\register .endm @ and calls for the 15 general purpose registers (2 bytes each). diff --git a/libc/sysdeps/linux/arm/crtn.S b/libc/sysdeps/linux/arm/crtn.S index a4752c186..de01b38dc 100644 --- a/libc/sysdeps/linux/arm/crtn.S +++ b/libc/sysdeps/linux/arm/crtn.S @@ -15,6 +15,7 @@ .arm ldmdb fp, {r4, r5, r6, r7, r8, r9, sl, fp, sp, pc} #endif + .size _init, .-_init .section .fini .global _fini @@ -28,6 +29,7 @@ .arm ldmdb fp, {r4, r5, r6, r7, r8, r9, sl, fp, sp, pc} #endif + .size _fini, .-_fini @ In fact this is modified to 3.4.4 .ident "GCC: (GNU) 3.3.2 20031005 (Debian prerelease)" diff --git a/libc/sysdeps/linux/avr32/crt1.S b/libc/sysdeps/linux/avr32/crt1.S index e2a82a528..ca1fa7a4c 100644 --- a/libc/sysdeps/linux/avr32/crt1.S +++ b/libc/sysdeps/linux/avr32/crt1.S @@ -80,6 +80,7 @@ __main_addr: ___uClibc_main_addr: .long __uClibc_main #endif + .size _start, . - _start /* * The LSB says we need this. diff --git a/libc/sysdeps/linux/avr32/crtn.S b/libc/sysdeps/linux/avr32/crtn.S index c37f7d201..f7d104070 100644 --- a/libc/sysdeps/linux/avr32/crtn.S +++ b/libc/sysdeps/linux/avr32/crtn.S @@ -4,9 +4,11 @@ .global _init .type _init, @function ldm sp++, r6, pc + .size _init, . - _init .section .fini .align 2 .global _fini .type _fini, @function ldm sp++, r6, pc + .size _fini, . - _fini diff --git a/libc/sysdeps/linux/cris/crt1.S b/libc/sysdeps/linux/cris/crt1.S index 1525a2b76..b07e36b51 100644 --- a/libc/sysdeps/linux/cris/crt1.S +++ b/libc/sysdeps/linux/cris/crt1.S @@ -9,6 +9,7 @@ .global __data_start .align 2 .type __data_start, @object + .size __data_start, 4 __data_start: .dword 0 @@ -52,3 +53,4 @@ _start: /* Leave control to the libc */ jsr __uClibc_main nop + .size _start, .-_start diff --git a/libc/sysdeps/linux/cris/crtn.S b/libc/sysdeps/linux/cris/crtn.S index 7b2dce17c..951ae5449 100644 --- a/libc/sysdeps/linux/cris/crtn.S +++ b/libc/sysdeps/linux/cris/crtn.S @@ -9,6 +9,7 @@ move.d [$sp+],$r1 Ret nop + .size _init, .-_init .section .fini .align 1 @@ -19,3 +20,4 @@ move.d [$sp+],$r1 Ret nop + .size _fini, .-_fini diff --git a/libc/sysdeps/linux/frv/crt0.S b/libc/sysdeps/linux/frv/crt0.S index a40b67e80..a1d07bb69 100644 --- a/libc/sysdeps/linux/frv/crt0.S +++ b/libc/sysdeps/linux/frv/crt0.S @@ -113,6 +113,7 @@ _start: /* Crash if somehow `exit' returns anyways. */ jmpl @(gr0,gr0) +.size _start,.-_start /* Define a symbol for the first piece of initialized data. */ .data diff --git a/libc/sysdeps/linux/frv/crtn.S b/libc/sysdeps/linux/frv/crtn.S index bd11901ad..1d58c0207 100644 --- a/libc/sysdeps/linux/frv/crtn.S +++ b/libc/sysdeps/linux/frv/crtn.S @@ -32,6 +32,7 @@ Cambridge, MA 02139, USA. */ ld @(sp,gr0), fp addi sp,#16,sp jmpl @(gr5,gr0) + .size _init, .-_init .section .fini,"x" .globl _fini @@ -40,3 +41,4 @@ Cambridge, MA 02139, USA. */ ld @(sp,gr0), fp addi sp,#16,sp jmpl @(gr5,gr0) + .size _fini, .-_fini diff --git a/libc/sysdeps/linux/h8300/crtn.S b/libc/sysdeps/linux/h8300/crtn.S index 8f9fa1fac..89e321868 100644 --- a/libc/sysdeps/linux/h8300/crtn.S +++ b/libc/sysdeps/linux/h8300/crtn.S @@ -14,6 +14,7 @@ ; #NO_APP mov.l @er7+,er6 rts + .size __init, .-__init ; #APP .section .fini @@ -23,6 +24,7 @@ ; #NO_APP mov.l @er7+,er6 rts + .size __fini, .-__fini ; #APP .end diff --git a/libc/sysdeps/linux/i386/crt1.S b/libc/sysdeps/linux/i386/crt1.S index 7dfeaf1a5..a133cb9e0 100644 --- a/libc/sysdeps/linux/i386/crt1.S +++ b/libc/sysdeps/linux/i386/crt1.S @@ -129,6 +129,7 @@ _start: #endif hlt /* Crash if somehow `exit' does return. */ +.size _start,.-_start /* Define a symbol for the first piece of initialized data. */ .data diff --git a/libc/sysdeps/linux/i386/crtn.S b/libc/sysdeps/linux/i386/crtn.S index 34d5b38e2..191250487 100644 --- a/libc/sysdeps/linux/i386/crtn.S +++ b/libc/sysdeps/linux/i386/crtn.S @@ -6,6 +6,7 @@ popl %ebx popl %ebp ret +.size _init,.-_init @@ -15,6 +16,7 @@ popl %ebx popl %ebp ret +.size _fini,.-_fini diff --git a/libc/sysdeps/linux/microblaze/crtn.S b/libc/sysdeps/linux/microblaze/crtn.S index 6f4ef60d3..da8c920ef 100644 --- a/libc/sysdeps/linux/microblaze/crtn.S +++ b/libc/sysdeps/linux/microblaze/crtn.S @@ -26,6 +26,7 @@ .end _init $Lfe2: + .size _init,$Lfe2-_init .section .fini .align 2 @@ -39,5 +40,6 @@ $Lfe2: .end _fini $Lfe3: + .size _fini,$Lfe3-_fini /*@TRAILER_BEGINS*/ diff --git a/libc/sysdeps/linux/mips/crt1.S b/libc/sysdeps/linux/mips/crt1.S index 90f69e9c8..6a804125e 100644 --- a/libc/sysdeps/linux/mips/crt1.S +++ b/libc/sysdeps/linux/mips/crt1.S @@ -118,6 +118,7 @@ __start: hlt: /* Crash if somehow `__uClibc_main' returns anyway. */ b hlt +.size __start,.-__start .end __start /* Define a symbol for the first piece of initialized data. */ diff --git a/libc/sysdeps/linux/powerpc/crt1.S b/libc/sysdeps/linux/powerpc/crt1.S index de3aa0814..4f1494a8f 100644 --- a/libc/sysdeps/linux/powerpc/crt1.S +++ b/libc/sysdeps/linux/powerpc/crt1.S @@ -95,6 +95,7 @@ _start: b __uClibc_main #endif +.size _start,.-_start /* Define a symbol for the first piece of initialized data. */ .data diff --git a/libc/sysdeps/linux/powerpc/crtn.S b/libc/sysdeps/linux/powerpc/crtn.S index 938367caa..ba6d0e0c8 100644 --- a/libc/sysdeps/linux/powerpc/crtn.S +++ b/libc/sysdeps/linux/powerpc/crtn.S @@ -9,6 +9,7 @@ addi 1,1,32 mtlr 0 blr + .size _init, .-_init .section .fini .align 2 @@ -19,3 +20,4 @@ addi 1,1,32 mtlr 0 blr + .size _fini, .-_fini diff --git a/libc/sysdeps/linux/sh/crt1.S b/libc/sysdeps/linux/sh/crt1.S index 277c55e69..9707f8316 100644 --- a/libc/sysdeps/linux/sh/crt1.S +++ b/libc/sysdeps/linux/sh/crt1.S @@ -104,6 +104,7 @@ _start: nop #endif + .size _start,.-_start .align 2 #ifdef __PIC__ diff --git a/libc/sysdeps/linux/sh/crtn.S b/libc/sysdeps/linux/sh/crtn.S index e8be7e51f..437f8ebc3 100644 --- a/libc/sysdeps/linux/sh/crtn.S +++ b/libc/sysdeps/linux/sh/crtn.S @@ -15,6 +15,7 @@ .align 2 .L6: .L7: + .size _init, .-_init .section .fini .hidden _fini @@ -30,5 +31,6 @@ .align 2 .L11: .L12: + .size _fini, .-_fini .ident "GCC: (GNU) 3.3.2" diff --git a/libc/sysdeps/linux/sh64/crtn.S b/libc/sysdeps/linux/sh64/crtn.S index 501fe9167..eb6479a56 100644 --- a/libc/sysdeps/linux/sh64/crtn.S +++ b/libc/sysdeps/linux/sh64/crtn.S @@ -14,6 +14,7 @@ ptabs r18, tr0 addi.l r15, 16, r15 blink tr0, r63 + .size _init, .-_init .section .fini .hidden _fini @@ -27,5 +28,6 @@ ptabs r18, tr0 addi.l r15, 16, r15 blink tr0, r63 + .size _fini, .-_fini .ident "GCC: (GNU) 3.3.2" diff --git a/libc/sysdeps/linux/sparc/crt1.S b/libc/sysdeps/linux/sparc/crt1.S index 78aaaccce..f33a714ef 100644 --- a/libc/sysdeps/linux/sparc/crt1.S +++ b/libc/sysdeps/linux/sparc/crt1.S @@ -123,6 +123,7 @@ _start: illtrap 0 #endif +.size _start,.-_start /* Define a symbol for the first piece of initialized data. */ .data diff --git a/libc/sysdeps/linux/sparc/crtn.S b/libc/sysdeps/linux/sparc/crtn.S index d64ffd020..24b4bf43c 100644 --- a/libc/sysdeps/linux/sparc/crtn.S +++ b/libc/sysdeps/linux/sparc/crtn.S @@ -7,6 +7,7 @@ .proc 020 ret restore + .size _init, .-_init .section .fini .align 4 @@ -15,3 +16,4 @@ .proc 020 ret restore + .size _fini, .-_fini diff --git a/libc/sysdeps/linux/v850/crtn.S b/libc/sysdeps/linux/v850/crtn.S index 6bb0b39ac..aecb55737 100644 --- a/libc/sysdeps/linux/v850/crtn.S +++ b/libc/sysdeps/linux/v850/crtn.S @@ -8,6 +8,7 @@ .type __init, @function #NO_APP jr __return_r31 + .size __init, .-__init #APP .section .fini @@ -17,6 +18,7 @@ .type __fini, @function #NO_APP jr __return_r31 + .size __fini, .-__fini #APP .ident "GCC: (GNU) 3.3.2" diff --git a/libc/sysdeps/linux/vax/crtn.S b/libc/sysdeps/linux/vax/crtn.S index 1153fd50b..6ca5c4fcd 100644 --- a/libc/sysdeps/linux/vax/crtn.S +++ b/libc/sysdeps/linux/vax/crtn.S @@ -9,6 +9,7 @@ __gnu_compiled_c: .type _init,@function ret .Lfe2: + .size _init,.Lfe2-_init .section .fini .align 1 @@ -16,4 +17,5 @@ __gnu_compiled_c: .type _fini,@function ret .Lfe3: + .size _fini,.Lfe3-_fini .ident "GCC: (GNU) 2.95.2 19991024 (release) (Linux/VAX CVS)" diff --git a/libc/sysdeps/linux/x86_64/crt1.S b/libc/sysdeps/linux/x86_64/crt1.S index a21be7583..f6c1eb1e7 100644 --- a/libc/sysdeps/linux/x86_64/crt1.S +++ b/libc/sysdeps/linux/x86_64/crt1.S @@ -129,6 +129,7 @@ _start: #endif hlt /* Crash if somehow `exit' does return. */ +.size _start,.-_start /* Define a symbol for the first piece of initialized data. */ .data diff --git a/libc/sysdeps/linux/x86_64/crtn.S b/libc/sysdeps/linux/x86_64/crtn.S index 9804e0f76..5b110d967 100644 --- a/libc/sysdeps/linux/x86_64/crtn.S +++ b/libc/sysdeps/linux/x86_64/crtn.S @@ -7,6 +7,7 @@ .type _init, %function addq $8, %rsp ret +.size _init,.-_init .section .fini @@ -14,3 +15,4 @@ .type _fini, %function addq $8, %rsp ret +.size _fini, .-_fini -- cgit v1.2.3 From 2297e6e1e075070d6e62dfe7cccfab600de12870 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Thu, 5 May 2011 09:27:15 +0200 Subject: x86_64: fix .size of _init/_fini binutils-2.21 barf on .size that do not evaluate to const, so use the section size and not a function that is not visible here. Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/x86_64/crtn.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/x86_64/crtn.S b/libc/sysdeps/linux/x86_64/crtn.S index 5b110d967..ec40c21d2 100644 --- a/libc/sysdeps/linux/x86_64/crtn.S +++ b/libc/sysdeps/linux/x86_64/crtn.S @@ -7,7 +7,7 @@ .type _init, %function addq $8, %rsp ret -.size _init,.-_init +.size _init,.-.init .section .fini @@ -15,4 +15,4 @@ .type _fini, %function addq $8, %rsp ret -.size _fini, .-_fini +.size _fini, .-.fini -- cgit v1.2.3 From 5cf382c0f98d1943bcf51ffa8bde6103e1f102ab Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Thu, 5 May 2011 09:33:14 +0200 Subject: i386: fix .size of _init/_fini binutils-2.21 barf on .size that do not evaluate to const, so use the section size and not a function that is not visible here. Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/i386/crtn.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/i386/crtn.S b/libc/sysdeps/linux/i386/crtn.S index 191250487..ce2608383 100644 --- a/libc/sysdeps/linux/i386/crtn.S +++ b/libc/sysdeps/linux/i386/crtn.S @@ -6,7 +6,7 @@ popl %ebx popl %ebp ret -.size _init,.-_init +.size _init,.-.init @@ -16,7 +16,7 @@ popl %ebx popl %ebp ret -.size _fini,.-_fini +.size _fini,.-.fini -- cgit v1.2.3 From 074930dd7f2a18a7013cdb72cc38136f3be39c40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Wed, 20 Apr 2011 13:59:15 +0300 Subject: posix_fadvise64: fix x86 implementation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 73d59554144f429b1cf0d4d7fa7de42bdf59ad92 completely broke the x86 implementation of posix_fadvise64. It moved the first the assembly code retn instruction gets missing depending on the Technically the file has two implementaions for posix_fadvise64, one when __NR_fadvise64_64 is available, and second one if only __NR_fadvise64 is there. Fix the #ifdef's to be proper for that. Signed-off-by: Timo Teräs Signed-off-by: Khem Raj --- libc/sysdeps/linux/i386/posix_fadvise64.S | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/i386/posix_fadvise64.S b/libc/sysdeps/linux/i386/posix_fadvise64.S index b4aeff1f4..8a8947d7b 100644 --- a/libc/sysdeps/linux/i386/posix_fadvise64.S +++ b/libc/sysdeps/linux/i386/posix_fadvise64.S @@ -22,7 +22,7 @@ #include #include -#if defined __NR_fadvise64_64 +#if defined __NR_fadvise64_64 || defined __NR_fadvise64 /* Was named __libc_posix_fadvise64 for some inexplicable reason. ** google says only uclibc has *__libc*_posix_fadviseXXX, @@ -35,6 +35,7 @@ .global posix_fadvise64 .type posix_fadvise64,%function posix_fadvise64: +#if defined __NR_fadvise64_64 /* Save regs */ pushl %ebp pushl %ebx @@ -91,6 +92,7 @@ overflow: /* Returns 0 on success, else an error code. */ negl %eax +#endif /* Successful; return the syscall's value. */ ret -- cgit v1.2.3 From 3e68c52b941636714d2599ea8adda9520ec2de23 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Tue, 10 May 2011 10:03:58 +0200 Subject: */crtn.S: Remove .size directive for _init and _fini These are split across objects so setting size does not (and never did) work since the expression cannot be computed at assembly time. This avoids errors from recent (> 2.21) gas. Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/arm/crtn.S | 2 -- libc/sysdeps/linux/avr32/crtn.S | 2 -- libc/sysdeps/linux/cris/crtn.S | 2 -- libc/sysdeps/linux/frv/crtn.S | 2 -- libc/sysdeps/linux/h8300/crtn.S | 2 -- libc/sysdeps/linux/i386/crtn.S | 2 -- libc/sysdeps/linux/microblaze/crtn.S | 2 -- libc/sysdeps/linux/powerpc/crtn.S | 2 -- libc/sysdeps/linux/sh/crtn.S | 2 -- libc/sysdeps/linux/sh64/crtn.S | 2 -- libc/sysdeps/linux/sparc/crtn.S | 2 -- libc/sysdeps/linux/v850/crtn.S | 2 -- libc/sysdeps/linux/vax/crtn.S | 2 -- libc/sysdeps/linux/x86_64/crtn.S | 2 -- 14 files changed, 28 deletions(-) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/arm/crtn.S b/libc/sysdeps/linux/arm/crtn.S index de01b38dc..a4752c186 100644 --- a/libc/sysdeps/linux/arm/crtn.S +++ b/libc/sysdeps/linux/arm/crtn.S @@ -15,7 +15,6 @@ .arm ldmdb fp, {r4, r5, r6, r7, r8, r9, sl, fp, sp, pc} #endif - .size _init, .-_init .section .fini .global _fini @@ -29,7 +28,6 @@ .arm ldmdb fp, {r4, r5, r6, r7, r8, r9, sl, fp, sp, pc} #endif - .size _fini, .-_fini @ In fact this is modified to 3.4.4 .ident "GCC: (GNU) 3.3.2 20031005 (Debian prerelease)" diff --git a/libc/sysdeps/linux/avr32/crtn.S b/libc/sysdeps/linux/avr32/crtn.S index f7d104070..c37f7d201 100644 --- a/libc/sysdeps/linux/avr32/crtn.S +++ b/libc/sysdeps/linux/avr32/crtn.S @@ -4,11 +4,9 @@ .global _init .type _init, @function ldm sp++, r6, pc - .size _init, . - _init .section .fini .align 2 .global _fini .type _fini, @function ldm sp++, r6, pc - .size _fini, . - _fini diff --git a/libc/sysdeps/linux/cris/crtn.S b/libc/sysdeps/linux/cris/crtn.S index 951ae5449..7b2dce17c 100644 --- a/libc/sysdeps/linux/cris/crtn.S +++ b/libc/sysdeps/linux/cris/crtn.S @@ -9,7 +9,6 @@ move.d [$sp+],$r1 Ret nop - .size _init, .-_init .section .fini .align 1 @@ -20,4 +19,3 @@ move.d [$sp+],$r1 Ret nop - .size _fini, .-_fini diff --git a/libc/sysdeps/linux/frv/crtn.S b/libc/sysdeps/linux/frv/crtn.S index 1d58c0207..bd11901ad 100644 --- a/libc/sysdeps/linux/frv/crtn.S +++ b/libc/sysdeps/linux/frv/crtn.S @@ -32,7 +32,6 @@ Cambridge, MA 02139, USA. */ ld @(sp,gr0), fp addi sp,#16,sp jmpl @(gr5,gr0) - .size _init, .-_init .section .fini,"x" .globl _fini @@ -41,4 +40,3 @@ Cambridge, MA 02139, USA. */ ld @(sp,gr0), fp addi sp,#16,sp jmpl @(gr5,gr0) - .size _fini, .-_fini diff --git a/libc/sysdeps/linux/h8300/crtn.S b/libc/sysdeps/linux/h8300/crtn.S index 89e321868..8f9fa1fac 100644 --- a/libc/sysdeps/linux/h8300/crtn.S +++ b/libc/sysdeps/linux/h8300/crtn.S @@ -14,7 +14,6 @@ ; #NO_APP mov.l @er7+,er6 rts - .size __init, .-__init ; #APP .section .fini @@ -24,7 +23,6 @@ ; #NO_APP mov.l @er7+,er6 rts - .size __fini, .-__fini ; #APP .end diff --git a/libc/sysdeps/linux/i386/crtn.S b/libc/sysdeps/linux/i386/crtn.S index ce2608383..34d5b38e2 100644 --- a/libc/sysdeps/linux/i386/crtn.S +++ b/libc/sysdeps/linux/i386/crtn.S @@ -6,7 +6,6 @@ popl %ebx popl %ebp ret -.size _init,.-.init @@ -16,7 +15,6 @@ popl %ebx popl %ebp ret -.size _fini,.-.fini diff --git a/libc/sysdeps/linux/microblaze/crtn.S b/libc/sysdeps/linux/microblaze/crtn.S index da8c920ef..6f4ef60d3 100644 --- a/libc/sysdeps/linux/microblaze/crtn.S +++ b/libc/sysdeps/linux/microblaze/crtn.S @@ -26,7 +26,6 @@ .end _init $Lfe2: - .size _init,$Lfe2-_init .section .fini .align 2 @@ -40,6 +39,5 @@ $Lfe2: .end _fini $Lfe3: - .size _fini,$Lfe3-_fini /*@TRAILER_BEGINS*/ diff --git a/libc/sysdeps/linux/powerpc/crtn.S b/libc/sysdeps/linux/powerpc/crtn.S index ba6d0e0c8..938367caa 100644 --- a/libc/sysdeps/linux/powerpc/crtn.S +++ b/libc/sysdeps/linux/powerpc/crtn.S @@ -9,7 +9,6 @@ addi 1,1,32 mtlr 0 blr - .size _init, .-_init .section .fini .align 2 @@ -20,4 +19,3 @@ addi 1,1,32 mtlr 0 blr - .size _fini, .-_fini diff --git a/libc/sysdeps/linux/sh/crtn.S b/libc/sysdeps/linux/sh/crtn.S index 437f8ebc3..e8be7e51f 100644 --- a/libc/sysdeps/linux/sh/crtn.S +++ b/libc/sysdeps/linux/sh/crtn.S @@ -15,7 +15,6 @@ .align 2 .L6: .L7: - .size _init, .-_init .section .fini .hidden _fini @@ -31,6 +30,5 @@ .align 2 .L11: .L12: - .size _fini, .-_fini .ident "GCC: (GNU) 3.3.2" diff --git a/libc/sysdeps/linux/sh64/crtn.S b/libc/sysdeps/linux/sh64/crtn.S index eb6479a56..501fe9167 100644 --- a/libc/sysdeps/linux/sh64/crtn.S +++ b/libc/sysdeps/linux/sh64/crtn.S @@ -14,7 +14,6 @@ ptabs r18, tr0 addi.l r15, 16, r15 blink tr0, r63 - .size _init, .-_init .section .fini .hidden _fini @@ -28,6 +27,5 @@ ptabs r18, tr0 addi.l r15, 16, r15 blink tr0, r63 - .size _fini, .-_fini .ident "GCC: (GNU) 3.3.2" diff --git a/libc/sysdeps/linux/sparc/crtn.S b/libc/sysdeps/linux/sparc/crtn.S index 24b4bf43c..d64ffd020 100644 --- a/libc/sysdeps/linux/sparc/crtn.S +++ b/libc/sysdeps/linux/sparc/crtn.S @@ -7,7 +7,6 @@ .proc 020 ret restore - .size _init, .-_init .section .fini .align 4 @@ -16,4 +15,3 @@ .proc 020 ret restore - .size _fini, .-_fini diff --git a/libc/sysdeps/linux/v850/crtn.S b/libc/sysdeps/linux/v850/crtn.S index aecb55737..6bb0b39ac 100644 --- a/libc/sysdeps/linux/v850/crtn.S +++ b/libc/sysdeps/linux/v850/crtn.S @@ -8,7 +8,6 @@ .type __init, @function #NO_APP jr __return_r31 - .size __init, .-__init #APP .section .fini @@ -18,7 +17,6 @@ .type __fini, @function #NO_APP jr __return_r31 - .size __fini, .-__fini #APP .ident "GCC: (GNU) 3.3.2" diff --git a/libc/sysdeps/linux/vax/crtn.S b/libc/sysdeps/linux/vax/crtn.S index 6ca5c4fcd..1153fd50b 100644 --- a/libc/sysdeps/linux/vax/crtn.S +++ b/libc/sysdeps/linux/vax/crtn.S @@ -9,7 +9,6 @@ __gnu_compiled_c: .type _init,@function ret .Lfe2: - .size _init,.Lfe2-_init .section .fini .align 1 @@ -17,5 +16,4 @@ __gnu_compiled_c: .type _fini,@function ret .Lfe3: - .size _fini,.Lfe3-_fini .ident "GCC: (GNU) 2.95.2 19991024 (release) (Linux/VAX CVS)" diff --git a/libc/sysdeps/linux/x86_64/crtn.S b/libc/sysdeps/linux/x86_64/crtn.S index ec40c21d2..9804e0f76 100644 --- a/libc/sysdeps/linux/x86_64/crtn.S +++ b/libc/sysdeps/linux/x86_64/crtn.S @@ -7,7 +7,6 @@ .type _init, %function addq $8, %rsp ret -.size _init,.-.init .section .fini @@ -15,4 +14,3 @@ .type _fini, %function addq $8, %rsp ret -.size _fini, .-.fini -- cgit v1.2.3 From e48bd60ce9a70d190acfee7db98c0f163a2c5fdb Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Tue, 10 May 2011 20:19:46 +0200 Subject: getcwd: Fix memory-leak in error path Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/getcwd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/common/getcwd.c b/libc/sysdeps/linux/common/getcwd.c index 75d7a1c8b..87510019e 100644 --- a/libc/sysdeps/linux/common/getcwd.c +++ b/libc/sysdeps/linux/common/getcwd.c @@ -69,7 +69,7 @@ static char *search_dir(dev_t this_dev, ino_t this_ino, char *path_buf, int path slen++; dp = opendir(path_buf); - if (dp == 0) { + if (!dp) { goto oops; } @@ -78,6 +78,7 @@ static char *search_dir(dev_t this_dev, ino_t this_ino, char *path_buf, int path if (slow_search || this_ino == d->d_ino) { # endif if (slen + strlen(d->d_name) > path_size) { + closedir(dp); goto oops; } strcpy(ptr + 1, d->d_name); -- cgit v1.2.3 From 74a2c71153b910ee4773866ee30be84730a4d5b8 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 11 May 2011 11:31:45 +0200 Subject: accept4: Implement cancellation .. and add proper prototype, move it into it's own obj and other such cleanups. Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/bits/kernel-features.h | 12 ++++++++++++ libc/sysdeps/linux/common/stubs.c | 4 ++++ 2 files changed, 16 insertions(+) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/common/bits/kernel-features.h b/libc/sysdeps/linux/common/bits/kernel-features.h index 68b881c09..b338e0770 100644 --- a/libc/sysdeps/linux/common/bits/kernel-features.h +++ b/libc/sysdeps/linux/common/bits/kernel-features.h @@ -454,6 +454,18 @@ #define __ASSUME_IEEE_RAISE_EXCEPTION 1 #endif +/* Support for the accept4 syscall was added in 2.6.28. */ +#if __LINUX_KERNEL_VERSION >= 0x02061c \ + && (defined __i386__ || defined __x86_64__ || defined __powerpc__ \ + || defined __sparc__ || defined __s390__) +# define __ASSUME_ACCEPT4 1 +#endif + +/* Support for the accept4 syscall for alpha was added after 2.6.33-rc1. */ +#if __LINUX_KERNEL_VERSION >= 0x020621 && defined __alpha__ +# define __ASSUME_ACCEPT4 1 +#endif + /* Support for the FUTEX_CLOCK_REALTIME flag was added in 2.6.29. */ #if __LINUX_KERNEL_VERSION >= 0x02061d # define __ASSUME_FUTEX_CLOCK_REALTIME 1 diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c index 655c64001..d9379874a 100644 --- a/libc/sysdeps/linux/common/stubs.c +++ b/libc/sysdeps/linux/common/stubs.c @@ -31,6 +31,10 @@ static int enosys_stub(void) # undef __NR_sync_file_range #endif +#ifndef __NR_accept4 +make_stub(accept4) +#endif + #ifndef __NR_bdflush make_stub(bdflush) #endif -- cgit v1.2.3 From 6af34270fa28a4274576a6d068e6a83346480f2e Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 11 May 2011 12:05:20 +0200 Subject: socketcalls: add stubs Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/stubs.c | 94 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c index d9379874a..1aa07de36 100644 --- a/libc/sysdeps/linux/common/stubs.c +++ b/libc/sysdeps/linux/common/stubs.c @@ -31,6 +31,32 @@ static int enosys_stub(void) # undef __NR_sync_file_range #endif +#ifndef __UCLIBC_HAS_SOCKET__ +# undef __NR_accept +# undef __NR_accept4 +# undef __NR_bind +# undef __NR_connect +# undef __NR_getpeername +# undef __NR_getsockname +# undef __NR_getsockopt +# undef __NR_listen +# undef __NR_recv +# undef __NR_recvfrom +# undef __NR_recvmsg +# undef __NR_send +# undef __NR_sendmsg +# undef __NR_sendto +# undef __NR_setsockopt +# undef __NR_shutdown +# undef __NR_socket +# undef __NR_socketcall +# undef __NR_socketpair +#endif + +#ifndef __NR_accept +make_stub(accept) +#endif + #ifndef __NR_accept4 make_stub(accept4) #endif @@ -39,6 +65,10 @@ make_stub(accept4) make_stub(bdflush) #endif +#ifndef __NR_bind +make_stub(bind) +#endif + #ifndef __NR_capget make_stub(capget) #endif @@ -47,6 +77,10 @@ make_stub(capget) make_stub(capset) #endif +#ifndef __NR_connect +make_stub(connect) +#endif + #ifndef __NR_create_module make_stub(create_module) #endif @@ -95,10 +129,22 @@ make_stub(fsetxattr) make_stub(get_kernel_syms) #endif +#ifndef __NR_getpeername +make_stub(getpeername) +#endif + #if !defined(__NR_getpgrp) && (defined(__NR_getpgid) && (defined(__NR_getpid) || defined(__NR_getxpid))) make_stub(getpgrp) #endif +#ifndef __NR_getsockname +make_stub(getsockname) +#endif + +#ifndef __NR_getsockopt +make_stub(getsockopt) +#endif + #ifndef __NR_getxattr make_stub(getxattr) #endif @@ -111,6 +157,10 @@ make_stub(init_module) make_stub(lgetxattr) #endif +#ifndef __NR_listen +make_stub(listen) +#endif + #ifndef __NR_listxattr make_stub(listxattr) #endif @@ -135,6 +185,18 @@ make_stub(pivot_root) make_stub(query_module) #endif +#ifndef __NR_recv +make_stub(recv) +#endif + +#ifndef __NR_recvfrom +make_stub(recvfrom) +#endif + +#ifndef __NR_recvmsg +make_stub(recvmsg) +#endif + #ifndef __NR_removexattr make_stub(removexattr) #endif @@ -147,14 +209,46 @@ make_stub(sched_getaffinity) make_stub(sched_setaffinity) #endif +#ifndef __NR_send +make_stub(send) +#endif + +#ifndef __NR_sendmsg +make_stub(sendmsg) +#endif + +#ifndef __NR_sendto +make_stub(sendto) +#endif + +#ifndef __NR_setsockopt +make_stub(setsockopt) +#endif + #ifndef __NR_setxattr make_stub(setxattr) #endif +#ifndef __NR_shutdown +make_stub(shutdown) +#endif + #if !defined(__NR_signalfd4) && !defined(__NR_signalfd) make_stub(signalfd) #endif +#ifndef __NR_socket +make_stub(socket) +#endif + +#ifndef __NR_socketcall +make_stub(socketcall) +#endif + +#ifndef __NR_socketpair +make_stub(socketpair) +#endif + #ifndef __NR_rt_sigtimedwait make_stub(sigtimedwait) make_stub(sigwaitinfo) -- cgit v1.2.3 From d3ddb92ea03c89fe7d56a0bcbfbe64743bc51210 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 11 May 2011 13:12:14 +0200 Subject: add pipe2() Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/Makefile.in | 3 ++- libc/sysdeps/linux/common/bits/kernel-features.h | 13 +++++++++++++ libc/sysdeps/linux/common/pipe2.c | 16 ++++++++++++++++ libc/sysdeps/linux/common/stubs.c | 8 ++++++++ 4 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 libc/sysdeps/linux/common/pipe2.c (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in index 8811268d0..d97c73dcb 100644 --- a/libc/sysdeps/linux/common/Makefile.in +++ b/libc/sysdeps/linux/common/Makefile.in @@ -19,7 +19,8 @@ CSRC-$(UCLIBC_LINUX_MODULE_24) += create_module.c query_module.c \ get_kernel_syms.c # we need these internally: fstatfs.c statfs.c CSRC-$(UCLIBC_LINUX_SPECIFIC) += capget.c capset.c inotify.c ioperm.c iopl.c \ - madvise.c modify_ldt.c personality.c ppoll.c prctl.c readahead.c reboot.c \ + madvise.c modify_ldt.c pipe2.c personality.c ppoll.c prctl.c \ + readahead.c reboot.c \ remap_file_pages.c sched_getaffinity.c sched_setaffinity.c \ sendfile64.c sendfile.c setfsgid.c setfsuid.c setresuid.c \ splice.c vmsplice.c tee.c signalfd.c swapoff.c swapon.c \ diff --git a/libc/sysdeps/linux/common/bits/kernel-features.h b/libc/sysdeps/linux/common/bits/kernel-features.h index b338e0770..6bf554457 100644 --- a/libc/sysdeps/linux/common/bits/kernel-features.h +++ b/libc/sysdeps/linux/common/bits/kernel-features.h @@ -309,6 +309,19 @@ # define __ASSUME_O_CLOEXEC 1 #endif +/* Support for various CLOEXEC and NONBLOCK flags was added for x86, + * x86-64, PPC, IA-64, and SPARC in 2.6.27. */ +#if __LINUX_KERNEL_VERSION >= 0x02061b \ + && (defined __i386__ || defined __x86_64__ || defined __powerpc__ \ + || defined __ia64__ || defined __sparc__ || defined __s390__) +/* # define __ASSUME_SOCK_CLOEXEC 1 */ +/* # define __ASSUME_IN_NONBLOCK 1 */ +# define __ASSUME_PIPE2 1 +/* # define __ASSUME_EVENTFD2 1 */ +/* # define __ASSUME_SIGNALFD4 1 */ +#endif + + /* These features were surely available with 2.4.12. */ #if __LINUX_KERNEL_VERSION >= 132108 && defined __mc68000__ # define __ASSUME_MMAP2_SYSCALL 1 diff --git a/libc/sysdeps/linux/common/pipe2.c b/libc/sysdeps/linux/common/pipe2.c new file mode 100644 index 000000000..0a3686d81 --- /dev/null +++ b/libc/sysdeps/linux/common/pipe2.c @@ -0,0 +1,16 @@ +/* vi: set sw=4 ts=4: */ +/* + * pipe2() for uClibc + * + * Copyright (C) 2011 Bernhard Reutner-Fischer + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#include +#include + +#ifdef __NR_pipe2 +_syscall2(int, pipe2, int *, filedes, int, flags) +libc_hidden_def(pipe2) +#endif diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c index 1aa07de36..f7c6dc5c5 100644 --- a/libc/sysdeps/linux/common/stubs.c +++ b/libc/sysdeps/linux/common/stubs.c @@ -31,6 +31,10 @@ static int enosys_stub(void) # undef __NR_sync_file_range #endif +#ifndef __UCLIBC_LINUX_SPECIFIC__ +# undef __NR_pipe2 +#endif + #ifndef __UCLIBC_HAS_SOCKET__ # undef __NR_accept # undef __NR_accept4 @@ -177,6 +181,10 @@ make_stub(lremovexattr) make_stub(lsetxattr) #endif +#ifndef __NR_pipe2 +make_stub(pipe2) +#endif + #ifndef __NR_pivot_root make_stub(pivot_root) #endif -- cgit v1.2.3 From bf5dd19d97991de30486abaedb1868f6eb049a70 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Wed, 11 May 2011 09:28:13 +0200 Subject: Implement epoll_create1 and epoll_pwait system calls. Note: TODO: This lacks cancellation support. Signed-off-by: Thierry Reding Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/epoll.c | 16 ++++++++++++++ libc/sysdeps/linux/common/sys/epoll.h | 40 +++++++++++++++++++++++++++++++---- libc/sysdeps/linux/x86_64/sys/epoll.h | 36 ++++++++++++++++++++++++++++++- 3 files changed, 87 insertions(+), 5 deletions(-) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/common/epoll.c b/libc/sysdeps/linux/common/epoll.c index dda92282e..41c4eacc2 100644 --- a/libc/sysdeps/linux/common/epoll.c +++ b/libc/sysdeps/linux/common/epoll.c @@ -17,6 +17,13 @@ _syscall1(int, epoll_create, int, size) #endif +/* + * epoll_create1() + */ +#ifdef __NR_epoll_create1 +_syscall1(int, epoll_create1, int, flags) +#endif + /* * epoll_ctl() */ @@ -29,4 +36,13 @@ _syscall4(int,epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event *, even */ #ifdef __NR_epoll_wait _syscall4(int, epoll_wait, int, epfd, struct epoll_event *, events, int, maxevents, int, timeout) +/* TODO: add cancellation for epoll_wait */ +#endif + +/* + * epoll_pwait() + */ +#ifdef __NR_epoll_pwait +_syscall5(int, epoll_pwait, int, epfd, struct epoll_event *, events, int, maxevents, int, timeout, __const sigset_t *, ss) +/* TODO: add cancellation for epoll_pwait */ #endif diff --git a/libc/sysdeps/linux/common/sys/epoll.h b/libc/sysdeps/linux/common/sys/epoll.h index 44e814bfd..f6a648872 100644 --- a/libc/sysdeps/linux/common/sys/epoll.h +++ b/libc/sysdeps/linux/common/sys/epoll.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +/* Copyright (C) 2002-2006, 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,6 +22,24 @@ #include #include +/* Get __sigset_t. */ +#include + +#ifndef __sigset_t_defined +# define __sigset_t_defined +typedef __sigset_t sigset_t; +#endif + + +/* Flags to be passed to epoll_create1. */ +enum + { + EPOLL_CLOEXEC = 02000000, +#define EPOLL_CLOEXEC EPOLL_CLOEXEC + EPOLL_NONBLOCK = 04000 +#define EPOLL_NONBLOCK EPOLL_NONBLOCK + }; + enum EPOLL_EVENTS { @@ -55,9 +73,9 @@ enum EPOLL_EVENTS /* Valid opcodes ( "op" parameter ) to issue to epoll_ctl(). */ -#define EPOLL_CTL_ADD 1 /* Add a file decriptor to the interface. */ -#define EPOLL_CTL_DEL 2 /* Remove a file decriptor from the interface. */ -#define EPOLL_CTL_MOD 3 /* Change file decriptor epoll_event structure. */ +#define EPOLL_CTL_ADD 1 /* Add a file descriptor to the interface. */ +#define EPOLL_CTL_DEL 2 /* Remove a file descriptor from the interface. */ +#define EPOLL_CTL_MOD 3 /* Change file descriptor epoll_event structure. */ typedef union epoll_data @@ -83,6 +101,10 @@ __BEGIN_DECLS returned by epoll_create() should be closed with close(). */ extern int epoll_create (int __size) __THROW; +/* Same as epoll_create but with a FLAGS parameter. The unused SIZE + parameter has been dropped. */ +extern int epoll_create1 (int __flags) __THROW; + /* Manipulate an epoll instance "epfd". Returns 0 in case of success, -1 in case of error ( the "errno" variable will contain the @@ -107,6 +129,16 @@ extern int epoll_ctl (int __epfd, int __op, int __fd, extern int epoll_wait (int __epfd, struct epoll_event *__events, int __maxevents, int __timeout); + +/* Same as epoll_wait, but the thread's signal mask is temporarily + and atomically replaced with the one provided as parameter. + + This function is a cancellation point and therefore not marked with + __THROW. */ +extern int epoll_pwait (int __epfd, struct epoll_event *__events, + int __maxevents, int __timeout, + __const __sigset_t *__ss); + __END_DECLS #endif /* sys/epoll.h */ diff --git a/libc/sysdeps/linux/x86_64/sys/epoll.h b/libc/sysdeps/linux/x86_64/sys/epoll.h index 02672d3c7..a8171cc36 100644 --- a/libc/sysdeps/linux/x86_64/sys/epoll.h +++ b/libc/sysdeps/linux/x86_64/sys/epoll.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002,2003,2004,2005,2006 Free Software Foundation, Inc. +/* Copyright (C) 2002-2008, 2010 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,6 +22,24 @@ #include #include +/* Get __sigset_t. */ +#include + +#ifndef __sigset_t_defined +# define __sigset_t_defined +typedef __sigset_t sigset_t; +#endif + + +/* Flags to be passed to epoll_create1. */ +enum + { + EPOLL_CLOEXEC = 02000000, +#define EPOLL_CLOEXEC EPOLL_CLOEXEC + EPOLL_NONBLOCK = 04000 +#define EPOLL_NONBLOCK EPOLL_NONBLOCK + }; + enum EPOLL_EVENTS { @@ -45,6 +63,8 @@ enum EPOLL_EVENTS #define EPOLLERR EPOLLERR EPOLLHUP = 0x010, #define EPOLLHUP EPOLLHUP + EPOLLRDHUP = 0x2000, +#define EPOLLRDHUP EPOLLRDHUP EPOLLONESHOT = (1 << 30), #define EPOLLONESHOT EPOLLONESHOT EPOLLET = (1 << 31) @@ -81,6 +101,10 @@ __BEGIN_DECLS returned by epoll_create() should be closed with close(). */ extern int epoll_create (int __size) __THROW; +/* Same as epoll_create but with a FLAGS parameter. The unused SIZE + parameter has been dropped. */ +extern int epoll_create1 (int __flags) __THROW; + /* Manipulate an epoll instance "epfd". Returns 0 in case of success, -1 in case of error ( the "errno" variable will contain the @@ -105,6 +129,16 @@ extern int epoll_ctl (int __epfd, int __op, int __fd, extern int epoll_wait (int __epfd, struct epoll_event *__events, int __maxevents, int __timeout); + +/* Same as epoll_wait, but the thread's signal mask is temporarily + and atomically replaced with the one provided as parameter. + + This function is a cancellation point and therefore not marked with + __THROW. */ +extern int epoll_pwait (int __epfd, struct epoll_event *__events, + int __maxevents, int __timeout, + __const __sigset_t *__ss); + __END_DECLS #endif /* sys/epoll.h */ -- cgit v1.2.3 From c91c3a2b27f5909e190cde4518383864298e82af Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 11 May 2011 22:03:33 +0200 Subject: commentary typo fix use cancellation (with two 'l') uniformly. Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/x86_64/sys/epoll.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/x86_64/sys/epoll.h b/libc/sysdeps/linux/x86_64/sys/epoll.h index a8171cc36..bd5b30812 100644 --- a/libc/sysdeps/linux/x86_64/sys/epoll.h +++ b/libc/sysdeps/linux/x86_64/sys/epoll.h @@ -73,9 +73,9 @@ enum EPOLL_EVENTS /* Valid opcodes ( "op" parameter ) to issue to epoll_ctl(). */ -#define EPOLL_CTL_ADD 1 /* Add a file decriptor to the interface. */ -#define EPOLL_CTL_DEL 2 /* Remove a file decriptor from the interface. */ -#define EPOLL_CTL_MOD 3 /* Change file decriptor epoll_event structure. */ +#define EPOLL_CTL_ADD 1 /* Add a file descriptor to the interface. */ +#define EPOLL_CTL_DEL 2 /* Remove a file descriptor from the interface. */ +#define EPOLL_CTL_MOD 3 /* Change file descriptor epoll_event structure. */ typedef union epoll_data -- cgit v1.2.3 From 3e72d1b5129c51cabf6b501a4698f7c2433781ce Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 11 May 2011 22:17:23 +0200 Subject: epoll: unify epoll.h --- libc/sysdeps/linux/common/sys/epoll.h | 26 +++++- libc/sysdeps/linux/x86_64/sys/epoll.h | 144 ---------------------------------- 2 files changed, 24 insertions(+), 146 deletions(-) delete mode 100644 libc/sysdeps/linux/x86_64/sys/epoll.h (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/common/sys/epoll.h b/libc/sysdeps/linux/common/sys/epoll.h index f6a648872..a04bd704c 100644 --- a/libc/sysdeps/linux/common/sys/epoll.h +++ b/libc/sysdeps/linux/common/sys/epoll.h @@ -32,12 +32,30 @@ typedef __sigset_t sigset_t; /* Flags to be passed to epoll_create1. */ + enum { +#if defined __alpha__ + EPOLL_CLOEXEC = 010000000, +# define EPOLL_CLOEXEC EPOLL_CLOEXEC + EPOLL_NONBLOCK = 04 +# define EPOLL_NONBLOCK EPOLL_NONBLOCK +#else +# if defined __sparc__ + EPOLL_CLOEXEC = 020000000, +# else EPOLL_CLOEXEC = 02000000, -#define EPOLL_CLOEXEC EPOLL_CLOEXEC +# endif +# define EPOLL_CLOEXEC EPOLL_CLOEXEC +# if defined __mips__ + EPOLL_NONBLOCK = 0200 +# elif defined __sparc__ + EPOLL_NONBLOCK = 040000 +# else EPOLL_NONBLOCK = 04000 +# endif #define EPOLL_NONBLOCK EPOLL_NONBLOCK +#endif }; @@ -90,7 +108,11 @@ struct epoll_event { uint32_t events; /* Epoll events */ epoll_data_t data; /* User data variable */ -}; +} +#if defined __x86_64__ +__attribute__((packed)) +#endif +; __BEGIN_DECLS diff --git a/libc/sysdeps/linux/x86_64/sys/epoll.h b/libc/sysdeps/linux/x86_64/sys/epoll.h deleted file mode 100644 index bd5b30812..000000000 --- a/libc/sysdeps/linux/x86_64/sys/epoll.h +++ /dev/null @@ -1,144 +0,0 @@ -/* Copyright (C) 2002-2008, 2010 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SYS_EPOLL_H -#define _SYS_EPOLL_H 1 - -#include -#include - -/* Get __sigset_t. */ -#include - -#ifndef __sigset_t_defined -# define __sigset_t_defined -typedef __sigset_t sigset_t; -#endif - - -/* Flags to be passed to epoll_create1. */ -enum - { - EPOLL_CLOEXEC = 02000000, -#define EPOLL_CLOEXEC EPOLL_CLOEXEC - EPOLL_NONBLOCK = 04000 -#define EPOLL_NONBLOCK EPOLL_NONBLOCK - }; - - -enum EPOLL_EVENTS - { - EPOLLIN = 0x001, -#define EPOLLIN EPOLLIN - EPOLLPRI = 0x002, -#define EPOLLPRI EPOLLPRI - EPOLLOUT = 0x004, -#define EPOLLOUT EPOLLOUT - EPOLLRDNORM = 0x040, -#define EPOLLRDNORM EPOLLRDNORM - EPOLLRDBAND = 0x080, -#define EPOLLRDBAND EPOLLRDBAND - EPOLLWRNORM = 0x100, -#define EPOLLWRNORM EPOLLWRNORM - EPOLLWRBAND = 0x200, -#define EPOLLWRBAND EPOLLWRBAND - EPOLLMSG = 0x400, -#define EPOLLMSG EPOLLMSG - EPOLLERR = 0x008, -#define EPOLLERR EPOLLERR - EPOLLHUP = 0x010, -#define EPOLLHUP EPOLLHUP - EPOLLRDHUP = 0x2000, -#define EPOLLRDHUP EPOLLRDHUP - EPOLLONESHOT = (1 << 30), -#define EPOLLONESHOT EPOLLONESHOT - EPOLLET = (1 << 31) -#define EPOLLET EPOLLET - }; - - -/* Valid opcodes ( "op" parameter ) to issue to epoll_ctl(). */ -#define EPOLL_CTL_ADD 1 /* Add a file descriptor to the interface. */ -#define EPOLL_CTL_DEL 2 /* Remove a file descriptor from the interface. */ -#define EPOLL_CTL_MOD 3 /* Change file descriptor epoll_event structure. */ - - -typedef union epoll_data -{ - void *ptr; - int fd; - uint32_t u32; - uint64_t u64; -} epoll_data_t; - -struct epoll_event -{ - uint32_t events; /* Epoll events */ - epoll_data_t data; /* User data variable */ -} __attribute__ ((__packed__)); - - -__BEGIN_DECLS - -/* Creates an epoll instance. Returns an fd for the new instance. - The "size" parameter is a hint specifying the number of file - descriptors to be associated with the new instance. The fd - returned by epoll_create() should be closed with close(). */ -extern int epoll_create (int __size) __THROW; - -/* Same as epoll_create but with a FLAGS parameter. The unused SIZE - parameter has been dropped. */ -extern int epoll_create1 (int __flags) __THROW; - - -/* Manipulate an epoll instance "epfd". Returns 0 in case of success, - -1 in case of error ( the "errno" variable will contain the - specific error code ) The "op" parameter is one of the EPOLL_CTL_* - constants defined above. The "fd" parameter is the target of the - operation. The "event" parameter describes which events the caller - is interested in and any associated user data. */ -extern int epoll_ctl (int __epfd, int __op, int __fd, - struct epoll_event *__event) __THROW; - - -/* Wait for events on an epoll instance "epfd". Returns the number of - triggered events returned in "events" buffer. Or -1 in case of - error with the "errno" variable set to the specific error code. The - "events" parameter is a buffer that will contain triggered - events. The "maxevents" is the maximum number of events to be - returned ( usually size of "events" ). The "timeout" parameter - specifies the maximum wait time in milliseconds (-1 == infinite). - - This function is a cancellation point and therefore not marked with - __THROW. */ -extern int epoll_wait (int __epfd, struct epoll_event *__events, - int __maxevents, int __timeout); - - -/* Same as epoll_wait, but the thread's signal mask is temporarily - and atomically replaced with the one provided as parameter. - - This function is a cancellation point and therefore not marked with - __THROW. */ -extern int epoll_pwait (int __epfd, struct epoll_event *__events, - int __maxevents, int __timeout, - __const __sigset_t *__ss); - -__END_DECLS - -#endif /* sys/epoll.h */ -- cgit v1.2.3 From 213709e1e14418f728b52c8fefb4af505c99d567 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Thu, 12 May 2011 10:07:25 +0200 Subject: socket: fix stubs Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/stubs.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/common/stubs.c b/libc/sysdeps/linux/common/stubs.c index f7c6dc5c5..e14bbc3a0 100644 --- a/libc/sysdeps/linux/common/stubs.c +++ b/libc/sysdeps/linux/common/stubs.c @@ -57,11 +57,11 @@ static int enosys_stub(void) # undef __NR_socketpair #endif -#ifndef __NR_accept +#if !defined __NR_accept && !defined __NR_socketcall && !defined __UCLIBC_HAS_SOCKET__ make_stub(accept) #endif -#ifndef __NR_accept4 +#if !defined __NR_accept4 && !defined __NR_socketcall && !defined __UCLIBC_HAS_SOCKET__ make_stub(accept4) #endif @@ -69,7 +69,7 @@ make_stub(accept4) make_stub(bdflush) #endif -#ifndef __NR_bind +#if !defined __NR_bind && !defined __NR_socketcall && !defined __UCLIBC_HAS_SOCKET__ make_stub(bind) #endif @@ -81,7 +81,7 @@ make_stub(capget) make_stub(capset) #endif -#ifndef __NR_connect +#if !defined __NR_connect && !defined __NR_socketcall && !defined __UCLIBC_HAS_SOCKET__ make_stub(connect) #endif @@ -133,7 +133,7 @@ make_stub(fsetxattr) make_stub(get_kernel_syms) #endif -#ifndef __NR_getpeername +#if !defined __NR_getpeername && !defined __NR_socketcall && !defined __UCLIBC_HAS_SOCKET__ make_stub(getpeername) #endif @@ -141,11 +141,11 @@ make_stub(getpeername) make_stub(getpgrp) #endif -#ifndef __NR_getsockname +#if !defined __NR_getsockname && !defined __NR_socketcall && !defined __UCLIBC_HAS_SOCKET__ make_stub(getsockname) #endif -#ifndef __NR_getsockopt +#if !defined __NR_getsockopt && !defined __NR_socketcall && !defined __UCLIBC_HAS_SOCKET__ make_stub(getsockopt) #endif @@ -161,7 +161,7 @@ make_stub(init_module) make_stub(lgetxattr) #endif -#ifndef __NR_listen +#if !defined __NR_listen && !defined __NR_socketcall && !defined __UCLIBC_HAS_SOCKET__ make_stub(listen) #endif @@ -193,15 +193,15 @@ make_stub(pivot_root) make_stub(query_module) #endif -#ifndef __NR_recv +#if !defined __NR_recv && !defined __NR_socketcall && !defined __UCLIBC_HAS_SOCKET__ make_stub(recv) #endif -#ifndef __NR_recvfrom +#if !defined __NR_recvfrom && !defined __NR_socketcall && !defined __UCLIBC_HAS_SOCKET__ make_stub(recvfrom) #endif -#ifndef __NR_recvmsg +#if !defined __NR_recvmsg && !defined __NR_socketcall && !defined __UCLIBC_HAS_SOCKET__ make_stub(recvmsg) #endif @@ -217,19 +217,19 @@ make_stub(sched_getaffinity) make_stub(sched_setaffinity) #endif -#ifndef __NR_send +#if !defined __NR_send && !defined __NR_socketcall && !defined __UCLIBC_HAS_SOCKET__ make_stub(send) #endif -#ifndef __NR_sendmsg +#if !defined __NR_sendmsg && !defined __NR_socketcall && !defined __UCLIBC_HAS_SOCKET__ make_stub(sendmsg) #endif -#ifndef __NR_sendto +#if !defined __NR_sendto && !defined __NR_socketcall && !defined __UCLIBC_HAS_SOCKET__ make_stub(sendto) #endif -#ifndef __NR_setsockopt +#if !defined __NR_setsockopt && !defined __NR_socketcall && !defined __UCLIBC_HAS_SOCKET__ make_stub(setsockopt) #endif @@ -237,7 +237,7 @@ make_stub(setsockopt) make_stub(setxattr) #endif -#ifndef __NR_shutdown +#if !defined __NR_shutdown && !defined __NR_socketcall && !defined __UCLIBC_HAS_SOCKET__ make_stub(shutdown) #endif @@ -245,15 +245,15 @@ make_stub(shutdown) make_stub(signalfd) #endif -#ifndef __NR_socket +#if !defined __NR_socket && !defined __NR_socketcall && !defined __UCLIBC_HAS_SOCKET__ make_stub(socket) #endif -#ifndef __NR_socketcall +#if !defined __NR_socketcall && !defined __NR_socketcall && !defined __UCLIBC_HAS_SOCKET__ make_stub(socketcall) #endif -#ifndef __NR_socketpair +#if !defined __NR_socketpair && !defined __NR_socketcall && !defined __UCLIBC_HAS_SOCKET__ make_stub(socketpair) #endif -- cgit v1.2.3 From 3fb846d24c2b74f6dba36580315e1666eca015ee Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Thu, 12 May 2011 10:30:48 +0200 Subject: NPTL: needs madvise internally This fixes 8d09a50a044638fde2ed3e1a1c4d3c7c5a3cce5c since NPTL also uses madvise internally. Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/Makefile.in | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in index d97c73dcb..27cbbf420 100644 --- a/libc/sysdeps/linux/common/Makefile.in +++ b/libc/sysdeps/linux/common/Makefile.in @@ -19,15 +19,14 @@ CSRC-$(UCLIBC_LINUX_MODULE_24) += create_module.c query_module.c \ get_kernel_syms.c # we need these internally: fstatfs.c statfs.c CSRC-$(UCLIBC_LINUX_SPECIFIC) += capget.c capset.c inotify.c ioperm.c iopl.c \ - madvise.c modify_ldt.c pipe2.c personality.c ppoll.c prctl.c \ + modify_ldt.c pipe2.c personality.c ppoll.c prctl.c \ readahead.c reboot.c \ remap_file_pages.c sched_getaffinity.c sched_setaffinity.c \ sendfile64.c sendfile.c setfsgid.c setfsuid.c setresuid.c \ splice.c vmsplice.c tee.c signalfd.c swapoff.c swapon.c \ sync_file_range.c sysctl.c sysinfo.c timerfd.c uselib.c vhangup.c -ifeq ($(UCLIBC_LINUX_SPECIFIC)$(UCLIBC_HAS_THREADS_NATIVE),yy) -CSRC-y += madvise.c -endif +# NPTL needs these internally: madvise.c +CSRC-$(findstring y,$(UCLIBC_LINUX_SPECIFIC)$(UCLIBC_HAS_THREADS_NATIVE)) += madvise.c ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y) CSRC- += fork.c getpid.c raise.c open.c close.c read.c write.c CSRC- += $(if $(findstring =arm=,=$(TARGET_ARCH)=),vfork.c) -- cgit v1.2.3 From c6057584e07fae9c8b96e6a5af0271b2e2bc85f6 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Fri, 13 May 2011 01:56:08 +0200 Subject: epoll.c: add cancellation to epoll_[p]wait() While there, fix epoll_pwait syscall, it takes 6 arguments Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/epoll.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/common/epoll.c b/libc/sysdeps/linux/common/epoll.c index 41c4eacc2..e3cbb00bf 100644 --- a/libc/sysdeps/linux/common/epoll.c +++ b/libc/sysdeps/linux/common/epoll.c @@ -9,6 +9,7 @@ #include #include +#include /* * epoll_create() @@ -35,14 +36,30 @@ _syscall4(int,epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event *, even * epoll_wait() */ #ifdef __NR_epoll_wait -_syscall4(int, epoll_wait, int, epfd, struct epoll_event *, events, int, maxevents, int, timeout) -/* TODO: add cancellation for epoll_wait */ +static int __NC(epoll_wait)(int epfd, struct epoll_event *events, int maxevents, int timeout) +{ + return INLINE_SYSCALL(epoll_wait, 4, epfd, events, maxevents, timeout); +} +CANCELLABLE_SYSCALL(int, epoll_wait, (int epfd, struct epoll_event *events, int maxevents, int timeout), + (epfd, events, maxevents, timeout)) #endif /* * epoll_pwait() */ #ifdef __NR_epoll_pwait -_syscall5(int, epoll_pwait, int, epfd, struct epoll_event *, events, int, maxevents, int, timeout, __const sigset_t *, ss) -/* TODO: add cancellation for epoll_pwait */ +# include + +# define __NR___syscall_epoll_pwait __NR_epoll_pwait +static __always_inline _syscall6(int, __syscall_epoll_pwait, int, epfd, struct epoll_event *, events, + int, maxevents, int, timeout, const sigset_t *, sigmask, size_t, sigsetsize) + +static int __NC(epoll_pwait)(int epfd, struct epoll_event *events, int maxevents, int timeout, + const sigset_t *set) +{ + return __syscall_epoll_pwait(epfd, events, maxevents, timeout, set, __SYSCALL_SIGSET_T_SIZE); +} +CANCELLABLE_SYSCALL(int, epoll_pwait, (int epfd, struct epoll_event *events, int maxevents, int timeout, + const sigset_t *set), + (epfd, events, maxevents, timeout, set)) #endif -- cgit v1.2.3 From 1bfe83b42b5b850c20ed8d35819cced510eaef3c Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Fri, 13 May 2011 12:16:29 +0200 Subject: epoll: redo cancellation to match master Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/epoll.c | 47 ++++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 15 deletions(-) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/common/epoll.c b/libc/sysdeps/linux/common/epoll.c index e3cbb00bf..85b0cfd2b 100644 --- a/libc/sysdeps/linux/common/epoll.c +++ b/libc/sysdeps/linux/common/epoll.c @@ -9,7 +9,11 @@ #include #include -#include +#ifdef __UCLIBC_HAS_THREADS_NATIVE__ +# include +#else +# define SINGLE_THREAD_P 1 +#endif /* * epoll_create() @@ -36,12 +40,21 @@ _syscall4(int,epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event *, even * epoll_wait() */ #ifdef __NR_epoll_wait -static int __NC(epoll_wait)(int epfd, struct epoll_event *events, int maxevents, int timeout) +extern __typeof(epoll_wait) __libc_epoll_wait; +int __libc_epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout) { - return INLINE_SYSCALL(epoll_wait, 4, epfd, events, maxevents, timeout); + if (SINGLE_THREAD_P) + return INLINE_SYSCALL(epoll_wait, 4, epfd, events, maxevents, timeout); +# ifdef __UCLIBC_HAS_THREADS_NATIVE__ + else { + int oldtype = LIBC_CANCEL_ASYNC (); + int result = INLINE_SYSCALL(epoll_wait, 4, epfd, events, maxevents, timeout); + LIBC_CANCEL_RESET (oldtype); + return result; + } +# endif } -CANCELLABLE_SYSCALL(int, epoll_wait, (int epfd, struct epoll_event *events, int maxevents, int timeout), - (epfd, events, maxevents, timeout)) +weak_alias(__libc_epoll_wait, epoll_wait) #endif /* @@ -50,16 +63,20 @@ CANCELLABLE_SYSCALL(int, epoll_wait, (int epfd, struct epoll_event *events, int #ifdef __NR_epoll_pwait # include -# define __NR___syscall_epoll_pwait __NR_epoll_pwait -static __always_inline _syscall6(int, __syscall_epoll_pwait, int, epfd, struct epoll_event *, events, - int, maxevents, int, timeout, const sigset_t *, sigmask, size_t, sigsetsize) - -static int __NC(epoll_pwait)(int epfd, struct epoll_event *events, int maxevents, int timeout, - const sigset_t *set) +extern __typeof(epoll_pwait) __libc_epoll_pwait; +int __libc_epoll_pwait(int epfd, struct epoll_event *events, int maxevents, + int timeout, const sigset_t *set) { - return __syscall_epoll_pwait(epfd, events, maxevents, timeout, set, __SYSCALL_SIGSET_T_SIZE); + if (SINGLE_THREAD_P) + return INLINE_SYSCALL(epoll_pwait, 6, epfd, events, maxevents, timeout, set, _NSIG / 8); +# ifdef __UCLIBC_HAS_THREADS_NATIVE__ + else { + int oldtype = LIBC_CANCEL_ASYNC (); + int result = INLINE_SYSCALL(epoll_pwait, 6, epfd, events, maxevents, timeout, set, _NSIG / 8); + LIBC_CANCEL_RESET (oldtype); + return result; + } +# endif } -CANCELLABLE_SYSCALL(int, epoll_pwait, (int epfd, struct epoll_event *events, int maxevents, int timeout, - const sigset_t *set), - (epfd, events, maxevents, timeout, set)) +weak_alias(__libc_epoll_pwait, epoll_pwait) #endif -- cgit v1.2.3 From 71d63ed75648da9b0b71afabb9c60aaad792c55c Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 13 May 2011 15:31:06 -0700 Subject: unwind.h: Move to libc/sysdeps from nptl sysdeps Signed-off-by: Khem Raj --- libc/sysdeps/linux/arm/unwind.h | 279 +++++++++++++++++++++++++++++++++++++ libc/sysdeps/linux/common/unwind.h | 220 +++++++++++++++++++++++++++++ 2 files changed, 499 insertions(+) create mode 100644 libc/sysdeps/linux/arm/unwind.h create mode 100644 libc/sysdeps/linux/common/unwind.h (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/arm/unwind.h b/libc/sysdeps/linux/arm/unwind.h new file mode 100644 index 000000000..eeb9cf8b6 --- /dev/null +++ b/libc/sysdeps/linux/arm/unwind.h @@ -0,0 +1,279 @@ +/* Header file for the ARM EABI unwinder + Copyright (C) 2003, 2004, 2005, 2009 Free Software Foundation, Inc. + Contributed by Paul Brook + + This file is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + In addition to the permissions in the GNU General Public License, the + Free Software Foundation gives you unlimited permission to link the + compiled version of this file into combinations with other programs, + and to distribute those combinations without any restriction coming + from the use of this file. (The General Public License restrictions + do apply in other respects; for example, they cover modification of + the file, and distribution when not linked into a combine + executable.) + + This file 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to + the Free Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* Language-independent unwinder header public defines. This contains both + ABI defined objects, and GNU support routines. */ + +#ifndef UNWIND_ARM_H +#define UNWIND_ARM_H + +#define __ARM_EABI_UNWINDER__ 1 + +#ifdef __cplusplus +extern "C" { +#endif + typedef unsigned _Unwind_Word __attribute__((__mode__(__word__))); + typedef signed _Unwind_Sword __attribute__((__mode__(__word__))); + typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__))); + typedef unsigned _Unwind_Internal_Ptr __attribute__((__mode__(__pointer__))); + typedef _Unwind_Word _uw; + typedef unsigned _uw64 __attribute__((mode(__DI__))); + typedef unsigned _uw16 __attribute__((mode(__HI__))); + typedef unsigned _uw8 __attribute__((mode(__QI__))); + + typedef enum + { + _URC_OK = 0, /* operation completed successfully */ + _URC_FOREIGN_EXCEPTION_CAUGHT = 1, + _URC_END_OF_STACK = 5, + _URC_HANDLER_FOUND = 6, + _URC_INSTALL_CONTEXT = 7, + _URC_CONTINUE_UNWIND = 8, + _URC_FAILURE = 9 /* unspecified failure of some kind */ + } + _Unwind_Reason_Code; + + typedef enum + { + _US_VIRTUAL_UNWIND_FRAME = 0, + _US_UNWIND_FRAME_STARTING = 1, + _US_UNWIND_FRAME_RESUME = 2, + _US_ACTION_MASK = 3, + _US_FORCE_UNWIND = 8, + _US_END_OF_STACK = 16 + } + _Unwind_State; + + /* Provided only for for compatibility with existing code. */ + typedef int _Unwind_Action; +#define _UA_SEARCH_PHASE 1 +#define _UA_CLEANUP_PHASE 2 +#define _UA_HANDLER_FRAME 4 +#define _UA_FORCE_UNWIND 8 +#define _UA_END_OF_STACK 16 +#define _URC_NO_REASON _URC_OK + + typedef struct _Unwind_Control_Block _Unwind_Control_Block; + typedef struct _Unwind_Context _Unwind_Context; + typedef _uw _Unwind_EHT_Header; + + + /* UCB: */ + + struct _Unwind_Control_Block + { +#ifdef _LIBC + /* For the benefit of code which assumes this is a scalar. All + glibc ever does is clear it. */ + _uw64 exception_class; +#else + char exception_class[8]; +#endif + void (*exception_cleanup)(_Unwind_Reason_Code, _Unwind_Control_Block *); + /* Unwinder cache, private fields for the unwinder's use */ + struct + { + _uw reserved1; /* Forced unwind stop fn, 0 if not forced */ + _uw reserved2; /* Personality routine address */ + _uw reserved3; /* Saved callsite address */ + _uw reserved4; /* Forced unwind stop arg */ + _uw reserved5; + } + unwinder_cache; + /* Propagation barrier cache (valid after phase 1): */ + struct + { + _uw sp; + _uw bitpattern[5]; + } + barrier_cache; + /* Cleanup cache (preserved over cleanup): */ + struct + { + _uw bitpattern[4]; + } + cleanup_cache; + /* Pr cache (for pr's benefit): */ + struct + { + _uw fnstart; /* function start address */ + _Unwind_EHT_Header *ehtp; /* pointer to EHT entry header word */ + _uw additional; /* additional data */ + _uw reserved1; + } + pr_cache; + long long int :0; /* Force alignment to 8-byte boundary */ + }; + + /* Virtual Register Set*/ + + typedef enum + { + _UVRSC_CORE = 0, /* integer register */ + _UVRSC_VFP = 1, /* vfp */ + _UVRSC_FPA = 2, /* fpa */ + _UVRSC_WMMXD = 3, /* Intel WMMX data register */ + _UVRSC_WMMXC = 4 /* Intel WMMX control register */ + } + _Unwind_VRS_RegClass; + + typedef enum + { + _UVRSD_UINT32 = 0, + _UVRSD_VFPX = 1, + _UVRSD_FPAX = 2, + _UVRSD_UINT64 = 3, + _UVRSD_FLOAT = 4, + _UVRSD_DOUBLE = 5 + } + _Unwind_VRS_DataRepresentation; + + typedef enum + { + _UVRSR_OK = 0, + _UVRSR_NOT_IMPLEMENTED = 1, + _UVRSR_FAILED = 2 + } + _Unwind_VRS_Result; + + /* Frame unwinding state. */ + typedef struct + { + /* The current word (bytes packed msb first). */ + _uw data; + /* Pointer to the next word of data. */ + _uw *next; + /* The number of bytes left in this word. */ + _uw8 bytes_left; + /* The number of words pointed to by ptr. */ + _uw8 words_left; + } + __gnu_unwind_state; + + typedef _Unwind_Reason_Code (*personality_routine) (_Unwind_State, + _Unwind_Control_Block *, _Unwind_Context *); + + _Unwind_VRS_Result _Unwind_VRS_Set(_Unwind_Context *, _Unwind_VRS_RegClass, + _uw, _Unwind_VRS_DataRepresentation, + void *); + + _Unwind_VRS_Result _Unwind_VRS_Get(_Unwind_Context *, _Unwind_VRS_RegClass, + _uw, _Unwind_VRS_DataRepresentation, + void *); + + _Unwind_VRS_Result _Unwind_VRS_Pop(_Unwind_Context *, _Unwind_VRS_RegClass, + _uw, _Unwind_VRS_DataRepresentation); + + + /* Support functions for the PR. */ +#define _Unwind_Exception _Unwind_Control_Block + typedef char _Unwind_Exception_Class[8]; + + void * _Unwind_GetLanguageSpecificData (_Unwind_Context *); + _Unwind_Ptr _Unwind_GetRegionStart (_Unwind_Context *); + + /* These two should never be used. */ + _Unwind_Ptr _Unwind_GetDataRelBase (_Unwind_Context *); + _Unwind_Ptr _Unwind_GetTextRelBase (_Unwind_Context *); + + /* Interface functions: */ + _Unwind_Reason_Code _Unwind_RaiseException(_Unwind_Control_Block *ucbp); + void __attribute__((noreturn)) _Unwind_Resume(_Unwind_Control_Block *ucbp); + _Unwind_Reason_Code _Unwind_Resume_or_Rethrow (_Unwind_Control_Block *ucbp); + + typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) + (int, _Unwind_Action, _Unwind_Exception_Class, + _Unwind_Control_Block *, struct _Unwind_Context *, void *); + _Unwind_Reason_Code _Unwind_ForcedUnwind (_Unwind_Control_Block *, + _Unwind_Stop_Fn, void *); + _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *); + void _Unwind_Complete(_Unwind_Control_Block *ucbp); + void _Unwind_DeleteException (_Unwind_Exception *); + + _Unwind_Reason_Code __gnu_unwind_frame (_Unwind_Control_Block *, + _Unwind_Context *); + _Unwind_Reason_Code __gnu_unwind_execute (_Unwind_Context *, + __gnu_unwind_state *); + + /* Decode an R_ARM_TARGET2 relocation. */ + static inline _Unwind_Word + _Unwind_decode_target2 (_Unwind_Word ptr) + { + _Unwind_Word tmp; + + tmp = *(_Unwind_Word *) ptr; + /* Zero values are always NULL. */ + if (!tmp) + return 0; + +#if defined(linux) || defined(__NetBSD__) + /* Pc-relative indirect. */ + tmp += ptr; + tmp = *(_Unwind_Word *) tmp; +#elif defined(__symbian__) + /* Absolute pointer. Nothing more to do. */ +#else + /* Pc-relative pointer. */ + tmp += ptr; +#endif + return tmp; + } + + static inline _Unwind_Word + _Unwind_GetGR (_Unwind_Context *context, int regno) + { + _uw val; + _Unwind_VRS_Get (context, _UVRSC_CORE, regno, _UVRSD_UINT32, &val); + return val; + } + + /* Return the address of the instruction, not the actual IP value. */ +#define _Unwind_GetIP(context) \ + (_Unwind_GetGR (context, 15) & ~(_Unwind_Word)1) + + static inline void + _Unwind_SetGR (_Unwind_Context *context, int regno, _Unwind_Word val) + { + _Unwind_VRS_Set (context, _UVRSC_CORE, regno, _UVRSD_UINT32, &val); + } + + /* The dwarf unwinder doesn't understand arm/thumb state. We assume the + landing pad uses the same instruction set as the call site. */ +#define _Unwind_SetIP(context, val) \ + _Unwind_SetGR (context, 15, val | (_Unwind_GetGR (context, 15) & 1)) + +typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn) + (struct _Unwind_Context *, void *); + +extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* defined UNWIND_ARM_H */ diff --git a/libc/sysdeps/linux/common/unwind.h b/libc/sysdeps/linux/common/unwind.h new file mode 100644 index 000000000..81fc4db55 --- /dev/null +++ b/libc/sysdeps/linux/common/unwind.h @@ -0,0 +1,220 @@ +/* Exception handling and frame unwind runtime interface routines. + Copyright (C) 2001, 2003 Free Software Foundation, Inc. + + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +/* This is derived from the C++ ABI for IA-64. Where we diverge + for cross-architecture compatibility are noted with "@@@". */ + +#ifndef _UNWIND_H +#define _UNWIND_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* Level 1: Base ABI */ + +/* @@@ The IA-64 ABI uses uint64 throughout. Most places this is + inefficient for 32-bit and smaller machines. */ +typedef unsigned _Unwind_Word __attribute__((__mode__(__word__))); +typedef signed _Unwind_Sword __attribute__((__mode__(__word__))); +#if defined(__ia64__) && defined(__hpux__) +typedef unsigned _Unwind_Ptr __attribute__((__mode__(__word__))); +#else +typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__))); +#endif +typedef unsigned _Unwind_Internal_Ptr __attribute__((__mode__(__pointer__))); + +/* @@@ The IA-64 ABI uses a 64-bit word to identify the producer and + consumer of an exception. We'll go along with this for now even on + 32-bit machines. We'll need to provide some other option for + 16-bit machines and for machines with > 8 bits per byte. */ +typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__DI__))); + +/* The unwind interface uses reason codes in several contexts to + identify the reasons for failures or other actions. */ +typedef enum +{ + _URC_NO_REASON = 0, + _URC_FOREIGN_EXCEPTION_CAUGHT = 1, + _URC_FATAL_PHASE2_ERROR = 2, + _URC_FATAL_PHASE1_ERROR = 3, + _URC_NORMAL_STOP = 4, + _URC_END_OF_STACK = 5, + _URC_HANDLER_FOUND = 6, + _URC_INSTALL_CONTEXT = 7, + _URC_CONTINUE_UNWIND = 8 +} _Unwind_Reason_Code; + + +/* The unwind interface uses a pointer to an exception header object + as its representation of an exception being thrown. In general, the + full representation of an exception object is language- and + implementation-specific, but it will be prefixed by a header + understood by the unwind interface. */ + +struct _Unwind_Exception; + +typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code, + struct _Unwind_Exception *); + +struct _Unwind_Exception +{ + _Unwind_Exception_Class exception_class; + _Unwind_Exception_Cleanup_Fn exception_cleanup; + _Unwind_Word private_1; + _Unwind_Word private_2; + + /* @@@ The IA-64 ABI says that this structure must be double-word aligned. + Taking that literally does not make much sense generically. Instead we + provide the maximum alignment required by any type for the machine. */ +} __attribute__((__aligned__)); + + +/* The ACTIONS argument to the personality routine is a bitwise OR of one + or more of the following constants. */ +typedef int _Unwind_Action; + +#define _UA_SEARCH_PHASE 1 +#define _UA_CLEANUP_PHASE 2 +#define _UA_HANDLER_FRAME 4 +#define _UA_FORCE_UNWIND 8 +#define _UA_END_OF_STACK 16 + +/* This is an opaque type used to refer to a system-specific data + structure used by the system unwinder. This context is created and + destroyed by the system, and passed to the personality routine + during unwinding. */ +struct _Unwind_Context; + +/* Raise an exception, passing along the given exception object. */ +extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *); + +/* Raise an exception for forced unwinding. */ + +typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) + (int, _Unwind_Action, _Unwind_Exception_Class, + struct _Unwind_Exception *, struct _Unwind_Context *, void *); + +extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *, + _Unwind_Stop_Fn, + void *); + +/* Helper to invoke the exception_cleanup routine. */ +extern void _Unwind_DeleteException (struct _Unwind_Exception *); + +/* Resume propagation of an existing exception. This is used after + e.g. executing cleanup code, and not to implement rethrowing. */ +extern void _Unwind_Resume (struct _Unwind_Exception *); + +/* @@@ Use unwind data to perform a stack backtrace. The trace callback + is called for every stack frame in the call chain, but no cleanup + actions are performed. */ +typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn) + (struct _Unwind_Context *, void *); + +extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *); + +/* These functions are used for communicating information about the unwind + context (i.e. the unwind descriptors and the user register state) between + the unwind library and the personality routine and landing pad. Only + selected registers maybe manipulated. */ + +extern _Unwind_Word _Unwind_GetGR (struct _Unwind_Context *, int); +extern void _Unwind_SetGR (struct _Unwind_Context *, int, _Unwind_Word); + +extern _Unwind_Ptr _Unwind_GetIP (struct _Unwind_Context *); +extern void _Unwind_SetIP (struct _Unwind_Context *, _Unwind_Ptr); + +/* @@@ Retrieve the CFA of the given context. */ +extern _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *); + +extern void *_Unwind_GetLanguageSpecificData (struct _Unwind_Context *); + +extern _Unwind_Ptr _Unwind_GetRegionStart (struct _Unwind_Context *); + + +/* The personality routine is the function in the C++ (or other language) + runtime library which serves as an interface between the system unwind + library and language-specific exception handling semantics. It is + specific to the code fragment described by an unwind info block, and + it is always referenced via the pointer in the unwind info block, and + hence it has no ABI-specified name. + + Note that this implies that two different C++ implementations can + use different names, and have different contents in the language + specific data area. Moreover, that the language specific data + area contains no version info because name of the function invoked + provides more effective versioning by detecting at link time the + lack of code to handle the different data format. */ + +typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn) + (int, _Unwind_Action, _Unwind_Exception_Class, + struct _Unwind_Exception *, struct _Unwind_Context *); + +/* @@@ The following alternate entry points are for setjmp/longjmp + based unwinding. */ + +struct SjLj_Function_Context; +extern void _Unwind_SjLj_Register (struct SjLj_Function_Context *); +extern void _Unwind_SjLj_Unregister (struct SjLj_Function_Context *); + +extern _Unwind_Reason_Code _Unwind_SjLj_RaiseException + (struct _Unwind_Exception *); +extern _Unwind_Reason_Code _Unwind_SjLj_ForcedUnwind + (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *); +extern void _Unwind_SjLj_Resume (struct _Unwind_Exception *); + +/* @@@ The following provide access to the base addresses for text + and data-relative addressing in the LDSA. In order to stay link + compatible with the standard ABI for IA-64, we inline these. */ + +#ifdef __ia64__ +#include + +static inline _Unwind_Ptr +_Unwind_GetDataRelBase (struct _Unwind_Context *_C) +{ + /* The GP is stored in R1. */ + return _Unwind_GetGR (_C, 1); +} + +static inline _Unwind_Ptr +_Unwind_GetTextRelBase (struct _Unwind_Context *_C) +{ + abort (); + return 0; +} + +/* @@@ Retrieve the Backing Store Pointer of the given context. */ +extern _Unwind_Word _Unwind_GetBSP (struct _Unwind_Context *); +#else +extern _Unwind_Ptr _Unwind_GetDataRelBase (struct _Unwind_Context *); +extern _Unwind_Ptr _Unwind_GetTextRelBase (struct _Unwind_Context *); +#endif + +/* @@@ Given an address, return the entry point of the function that + contains it. */ +extern void * _Unwind_FindEnclosingFunction (void *pc); + +#ifdef __cplusplus +} +#endif + +#endif /* unwind.h */ -- cgit v1.2.3 From 5e87d86aceed23e9f2cffe4e6cbcd99569a4dac1 Mon Sep 17 00:00:00 2001 From: Filippo Arcidiacono Date: Fri, 27 May 2011 17:08:36 +0200 Subject: sh: fix build in !NPTL case Fix build issue due to missing symbols in !NPTL case: - vfork - _longjmp_unwind Signed-off-by: Filippo Arcidiacono Signed-off-by: Carmelo Amoroso --- libc/sysdeps/linux/sh/Makefile.arch | 2 +- libc/sysdeps/linux/sh/longjmp.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/sh/Makefile.arch b/libc/sysdeps/linux/sh/Makefile.arch index 3e32e1095..09d7ecffe 100644 --- a/libc/sysdeps/linux/sh/Makefile.arch +++ b/libc/sysdeps/linux/sh/Makefile.arch @@ -9,4 +9,4 @@ CSRC := \ mmap.c pipe.c __init_brk.c brk.c sbrk.c pread_write.c longjmp.c cacheflush.c -SSRC := setjmp.S __longjmp.S ___fpscr_values.S +SSRC := setjmp.S __longjmp.S ___fpscr_values.S vfork.S diff --git a/libc/sysdeps/linux/sh/longjmp.c b/libc/sysdeps/linux/sh/longjmp.c index dd0616d8a..28ab71515 100644 --- a/libc/sysdeps/linux/sh/longjmp.c +++ b/libc/sysdeps/linux/sh/longjmp.c @@ -29,7 +29,9 @@ libc_hidden_proto(sigprocmask) extern int __longjmp(char *env, int val); libc_hidden_proto(__longjmp) +#ifdef __UCLIBC_HAS_THREADS_NATIVE__ extern void _longjmp_unwind (jmp_buf env, int val); +#endif /* Set the signal mask to the one specified in ENV, and jump @@ -39,7 +41,9 @@ void __libc_siglongjmp (sigjmp_buf env, int val) { /* Perform any cleanups needed by the frames being unwound. */ +#if __UCLIBC_HAS_THREADS_NATIVE__ _longjmp_unwind (env, val); +#endif if (env[0].__mask_was_saved) /* Restore the saved signal mask. */ -- cgit v1.2.3 From 461c76887fa071aa428a17ef05cb2eb4eed1f93c Mon Sep 17 00:00:00 2001 From: Filippo Arcidiacono Date: Fri, 27 May 2011 17:17:51 +0200 Subject: sh: use the common implementation for longjmp Signed-off-by: Filippo Arcidiacono Signed-off-by: Carmelo Amoroso --- libc/sysdeps/linux/common/Makefile.in | 2 +- libc/sysdeps/linux/sh/Makefile.arch | 2 +- libc/sysdeps/linux/sh/longjmp.c | 60 ----------------------------------- 3 files changed, 2 insertions(+), 62 deletions(-) delete mode 100644 libc/sysdeps/linux/sh/longjmp.c (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in index 27cbbf420..8f936ffcc 100644 --- a/libc/sysdeps/linux/common/Makefile.in +++ b/libc/sysdeps/linux/common/Makefile.in @@ -52,7 +52,7 @@ CSRC-$(UCLIBC_HAS_XATTR) += xattr.c CSRC-$(UCLIBC_HAS_PROFILING) += noophooks.c #pcprofile.c CSRC-$(UCLIBC_SV4_DEPRECATED) += ustat.c CSRC- += $(if $(findstring =c6x=,=$(TARGET_ARCH)=),vfork.c) -CSRC- += $(if $(findstring =sh=,=$(TARGET_ARCH)=),longjmp.c vfork.c) +CSRC- += $(if $(findstring =sh=,=$(TARGET_ARCH)=),vfork.c) CSRC- += $(if $(findstring =sparc=,=$(TARGET_ARCH)=),vfork.c) CSRC- += $(if $(findstring =i386=,=$(TARGET_ARCH)=),vfork.c) diff --git a/libc/sysdeps/linux/sh/Makefile.arch b/libc/sysdeps/linux/sh/Makefile.arch index 09d7ecffe..92e262b6c 100644 --- a/libc/sysdeps/linux/sh/Makefile.arch +++ b/libc/sysdeps/linux/sh/Makefile.arch @@ -7,6 +7,6 @@ # CSRC := \ - mmap.c pipe.c __init_brk.c brk.c sbrk.c pread_write.c longjmp.c cacheflush.c + mmap.c pipe.c __init_brk.c brk.c sbrk.c pread_write.c cacheflush.c SSRC := setjmp.S __longjmp.S ___fpscr_values.S vfork.S diff --git a/libc/sysdeps/linux/sh/longjmp.c b/libc/sysdeps/linux/sh/longjmp.c deleted file mode 100644 index 28ab71515..000000000 --- a/libc/sysdeps/linux/sh/longjmp.c +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (C) 1991, 92, 94, 95, 97, 98, 2000 Free Software Foundation, Inc. - Copyright (C) 2001 Hewlett-Packard Australia - - 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 - - Derived in part from the Linux-8086 C library, the GNU C Library, and several - other sundry sources. Files within this library are copyright by their - respective copyright holders. -*/ - -#include -#include -#include - -libc_hidden_proto(sigprocmask) - -extern int __longjmp(char *env, int val); -libc_hidden_proto(__longjmp) - -#ifdef __UCLIBC_HAS_THREADS_NATIVE__ -extern void _longjmp_unwind (jmp_buf env, int val); -#endif - - -/* Set the signal mask to the one specified in ENV, and jump - to the position specified in ENV, causing the setjmp - call there to return VAL, or 1 if VAL is 0. */ -void __libc_siglongjmp (sigjmp_buf env, int val) -{ - /* Perform any cleanups needed by the frames being unwound. */ - -#if __UCLIBC_HAS_THREADS_NATIVE__ - _longjmp_unwind (env, val); -#endif - - if (env[0].__mask_was_saved) - /* Restore the saved signal mask. */ - (void) sigprocmask (SIG_SETMASK, &env[0].__saved_mask, - (sigset_t *) NULL); - - /* Call the machine-dependent function to restore machine state. */ - __longjmp ((char *) env[0].__jmpbuf, val ?: 1); -} - -__asm__(".weak longjmp; longjmp = __libc_siglongjmp"); -__asm__(".weak _longjmp; _longjmp = __libc_siglongjmp"); -__asm__(".weak siglongjmp; siglongjmp = __libc_siglongjmp"); -strong_alias(__libc_siglongjmp, __libc_longjmp) -- cgit v1.2.3 From 204c7849029d90e5e3486670a6a07a76f949afd6 Mon Sep 17 00:00:00 2001 From: Filippo Arcidiacono Date: Fri, 27 May 2011 17:36:20 +0200 Subject: libc: make common longjmp usable with NPTL Call _longjmp_unwind conditionally under NPTL config option, making longjmp usable with NPTL. Signed-off-by: Filippo Arcidiacono Signed-off-by: Carmelo Amoroso --- libc/sysdeps/linux/common/longjmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/common/longjmp.c b/libc/sysdeps/linux/common/longjmp.c index b07eced6a..f3448bc6f 100644 --- a/libc/sysdeps/linux/common/longjmp.c +++ b/libc/sysdeps/linux/common/longjmp.c @@ -24,7 +24,7 @@ extern void __longjmp (__jmp_buf __env, int __val) attribute_noreturn; libc_hidden_proto(__longjmp) -#if 0 +#ifdef __UCLIBC_HAS_THREADS_NATIVE__ extern void _longjmp_unwind (jmp_buf env, int val); #endif @@ -34,7 +34,7 @@ extern __typeof(longjmp) __libc_longjmp attribute_noreturn; call there to return VAL, or 1 if VAL is 0. */ void __libc_longjmp (sigjmp_buf env, int val) { -#if 0 +#ifdef __UCLIBC_HAS_THREADS_NATIVE__ /* Perform any cleanups needed by the frames being unwound. */ _longjmp_unwind (env, val); #endif -- cgit v1.2.3 From 8245f3b4638fdff2011c2657af1bb211def704bc Mon Sep 17 00:00:00 2001 From: Phil Blundell Date: Sat, 11 Jun 2011 01:10:46 -0400 Subject: Fix __libc_epoll_pwait compile failure on x86 This prevents "memory input 7 is not directly addressable" errors. | libc/sysdeps/linux/common/epoll.c: In function '__libc_epoll_pwait': | libc/sysdeps/linux/common/epoll.c:71:80: error: memory input 7 is not directly addressable | libc/sysdeps/linux/common/epoll.c:75:86: error: memory input 7 is not directly addressable | make: *** [libc/sysdeps/linux/common/epoll.o] Error 1 | make: *** Waiting for unfinished jobs.... Signed-off-by: Phil Blundell Signed-off-by: Jason Woodward Signed-off-by: Khem Raj --- libc/sysdeps/linux/common/epoll.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/common/epoll.c b/libc/sysdeps/linux/common/epoll.c index 85b0cfd2b..ab3e73bb7 100644 --- a/libc/sysdeps/linux/common/epoll.c +++ b/libc/sysdeps/linux/common/epoll.c @@ -67,12 +67,13 @@ extern __typeof(epoll_pwait) __libc_epoll_pwait; int __libc_epoll_pwait(int epfd, struct epoll_event *events, int maxevents, int timeout, const sigset_t *set) { + int nsig = _NSIG / 8; if (SINGLE_THREAD_P) - return INLINE_SYSCALL(epoll_pwait, 6, epfd, events, maxevents, timeout, set, _NSIG / 8); + return INLINE_SYSCALL(epoll_pwait, 6, epfd, events, maxevents, timeout, set, nsig); # ifdef __UCLIBC_HAS_THREADS_NATIVE__ else { int oldtype = LIBC_CANCEL_ASYNC (); - int result = INLINE_SYSCALL(epoll_pwait, 6, epfd, events, maxevents, timeout, set, _NSIG / 8); + int result = INLINE_SYSCALL(epoll_pwait, 6, epfd, events, maxevents, timeout, set, nsig); LIBC_CANCEL_RESET (oldtype); return result; } -- cgit v1.2.3 From 3862c65a05983b2b18cb7884a124a905828f7a18 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Sun, 9 Jan 2011 01:45:08 +0100 Subject: ARM: #include where __USE_BX__ is used The check for __USE_BX__ will be available in bits/arm_asm.h, so the latter must be included wherever the former is used. Signed-off-by: "Yann E. MORIN" Cc: Khem Raj Cc: Bernhard Reutner-Fischer Cc: Carmelo AMOROSO Signed-off-by: Khem Raj --- libc/sysdeps/linux/arm/sysdep.h | 1 + 1 file changed, 1 insertion(+) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/arm/sysdep.h b/libc/sysdeps/linux/arm/sysdep.h index 013f88cdd..e498695be 100644 --- a/libc/sysdeps/linux/arm/sysdep.h +++ b/libc/sysdeps/linux/arm/sysdep.h @@ -21,6 +21,7 @@ #define _LINUX_ARM_SYSDEP_H 1 #include +#include #include /* For Linux we can use the system call table in the header file -- cgit v1.2.3 From 7a246fda8e3bd2067d44e01c30c8ce761dad39a8 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Sun, 9 Jan 2011 01:45:09 +0100 Subject: ARM: detect BX availibility at build time The "use BX" option is now a suggestion that BX be used if available. Use a macro to detect if BX is available at build time. If so, and the user requested it be used, then use it. Otherwise, error out. Macro courtesy Khem RAJ: http://lists.uclibc.org/pipermail/uclibc/2009-April/042301.html Signed-off-by: "Yann E. MORIN" Cc: Khem Raj Cc: Bernhard Reutner-Fischer Cc: Carmelo AMOROSO Signed-off-by: Khem Raj --- libc/sysdeps/linux/arm/bits/arm_asm.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/arm/bits/arm_asm.h b/libc/sysdeps/linux/arm/bits/arm_asm.h index 1d87df6eb..921c9a3c9 100644 --- a/libc/sysdeps/linux/arm/bits/arm_asm.h +++ b/libc/sysdeps/linux/arm/bits/arm_asm.h @@ -24,5 +24,12 @@ #define THUMB1_ONLY 1 #endif -#endif /* _ARM_ASM_H */ +#if defined(__USE_BX__) +# if ( defined (__ARM_ARCH_2__) || defined (__ARM_ARCH_3__) \ + || defined (__ARM_ARCH_3M__) || defined (__ARM_ARCH_4__) \ + ) +# error Use of BX was requested, but is not available on the target processor. +# endif /* ARCH level */ +#endif /* __USE_BX__ */ +#endif /* _ARM_ASM_H */ -- cgit v1.2.3 From 4151e14cc8b60f5b3478d6c1f9372e427f7e05c4 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Sun, 9 Jan 2011 01:45:10 +0100 Subject: ARM: remove EABI/OABI selection Rely on the compiler to be properly setup for the default ABI. When installing-headers, there are two cases: - NPTL: no issue, a cross-compiler is already expected - LinuxThreads: no issue, EABI/OABI has no impact on installed headers. Signed-off-by: "Yann E. MORIN" Cc: Khem Raj Cc: Bernhard Reutner-Fischer Cc: Carmelo AMOROSO Signed-off-by: Khem Raj --- libc/sysdeps/linux/arm/Makefile.arch | 9 +++++++-- libc/sysdeps/linux/arm/bits/huge_val.h | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/arm/Makefile.arch b/libc/sysdeps/linux/arm/Makefile.arch index b53c539bf..14279e0d7 100644 --- a/libc/sysdeps/linux/arm/Makefile.arch +++ b/libc/sysdeps/linux/arm/Makefile.arch @@ -24,7 +24,12 @@ ifeq ($(UCLIBC_HAS_ADVANCED_REALTIME),y) CSRC += posix_fadvise.c posix_fadvise64.c endif -ifeq ($(CONFIG_ARM_EABI),y) +# Is our compiler set up for EABI ? +IS_EABI:=$(shell $(CC) $(CFLAGS) -x c - -E -dM /dev/null \ + |sed -r -e '/^\#[[:space:]]*define[[:space:]]+__ARM_EABI__([[:space:]]+1)?$$/!d; s/.+/y/;' \ + ) + +ifeq ($(IS_EABI),y) CSRC += aeabi_assert.c aeabi_atexit.c aeabi_errno_addr.c \ aeabi_localeconv.c aeabi_memclr.c aeabi_memcpy.c \ aeabi_memmove.c aeabi_memset.c find_exidx.c @@ -37,7 +42,7 @@ else CSRC += syscall.c endif -ifeq ($(CONFIG_ARM_EABI),y) +ifeq ($(IS_EABI),y) libc-static-y += $(ARCH_OUT)/aeabi_lcsts.o $(ARCH_OUT)/aeabi_math.o \ $(ARCH_OUT)/aeabi_sighandlers.o libc-nonshared-y += $(ARCH_OUT)/aeabi_lcsts.os $(ARCH_OUT)/aeabi_math.os \ diff --git a/libc/sysdeps/linux/arm/bits/huge_val.h b/libc/sysdeps/linux/arm/bits/huge_val.h index a215f3c0b..745e0bbd5 100644 --- a/libc/sysdeps/linux/arm/bits/huge_val.h +++ b/libc/sysdeps/linux/arm/bits/huge_val.h @@ -32,7 +32,7 @@ # define HUGE_VAL (__extension__ 0x1.0p2047) #elif defined __GNUC__ -#ifndef __CONFIG_ARM_EABI__ +#ifndef __ARM_EABI__ # define HUGE_VAL \ (__extension__ \ ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; }) \ @@ -50,7 +50,7 @@ typedef union { unsigned char __c[8]; double __d; } __huge_val_t; -#ifndef __CONFIG_ARM_EABI__ +#ifndef __ARM_EABI__ # if __BYTE_ORDER == __BIG_ENDIAN # define __HUGE_VAL_bytes { 0, 0, 0, 0, 0x7f, 0xf0, 0, 0 } # endif -- cgit v1.2.3 From c97ce776368ec5d9d954fc8653f3e1c11490fc74 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 13 Jun 2011 16:30:55 -0700 Subject: ctor/dtor nptl: Fix init and fini function compilation We need to define the rules for .S files so it gets the include paths some architectures like mips include headers Some architectures e.g. SH have their own version of pt-initfini.c so look for that first before resorting to generic version of pt-initfini.c Signed-off-by: Khem Raj --- libc/sysdeps/linux/mips/crtn.S | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/mips/crtn.S b/libc/sysdeps/linux/mips/crtn.S index cedd593f0..f3756a2f1 100644 --- a/libc/sysdeps/linux/mips/crtn.S +++ b/libc/sysdeps/linux/mips/crtn.S @@ -10,7 +10,6 @@ #NO_APP .align 2 .globl _init - .ent _init .type _init, @function #NO_APP lw $31,28($sp) @@ -22,14 +21,12 @@ .set macro .set reorder - .end _init #APP .section .fini #NO_APP .align 2 .globl _fini - .ent _fini .type _fini, @function #NO_APP lw $31,28($sp) @@ -41,7 +38,6 @@ .set macro .set reorder - .end _fini #APP .ident "GCC: (GNU) 3.3.2" @@ -54,10 +50,8 @@ .section .init #NO_APP - .align 2 .align 3 .globl _init - .ent _init .type _init, @function #NO_APP ld $31,8($sp) @@ -68,16 +62,12 @@ addiu $sp,$sp,16 .set macro .set reorder - - .end _init #APP .section .fini #NO_APP - .align 2 .align 3 .globl _fini - .ent _fini .type _fini, @function #NO_APP ld $31,8($sp) @@ -89,7 +79,6 @@ .set macro .set reorder - .end _fini #APP .ident "GCC: (GNU) 3.4.3" @@ -105,7 +94,6 @@ #NO_APP .align 2 .globl _init - .ent _init .type _init, @function #NO_APP ld $31,24($sp) @@ -118,14 +106,12 @@ .set macro .set reorder - .end _init #APP .section .fini #NO_APP .align 2 .globl _fini - .ent _fini .type _fini, @function #NO_APP ld $31,24($sp) @@ -138,7 +124,6 @@ .set macro .set reorder - .end _fini #APP .ident "GCC: (GNU) 3.3.2" -- cgit v1.2.3