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(-) 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(+) 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(-) 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(-) 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(-) 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(-) 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 974d3140577ac740c8db2f1ad9635c4ba591361e Mon Sep 17 00:00:00 2001 From: Filippo Arcidiacono Date: Fri, 6 May 2011 16:49:28 +0200 Subject: libdl: fix local symbol's address handling in dladdr Fix dladdr to correctly handle local function's address so backtrace_symbols print only the function address for these function, instead of showing the name of nearest one. Indeed the dladdr walk through the hash table to find the nearest symbol, that doesn't contain local symbols. Signed-off-by: Filippo Arcidiacono Signed-off-by: Carmelo Amoroso --- ldso/include/dl-defs.h | 8 ++++++++ ldso/libdl/libdl.c | 12 ++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ldso/include/dl-defs.h b/ldso/include/dl-defs.h index be0a81da3..88ff81593 100644 --- a/ldso/include/dl-defs.h +++ b/ldso/include/dl-defs.h @@ -179,6 +179,14 @@ typedef struct { #define DL_LOOKUP_ADDRESS(ADDRESS) (ADDRESS) #endif +/* On some architectures dladdr can't use st_size of all symbols this way. */ +#define DL_ADDR_SYM_MATCH(SYM_ADDR, SYM, MATCHSYM, ADDR) \ + ((ADDR) >= (SYM_ADDR) \ + && ((((SYM)->st_shndx == SHN_UNDEF || (SYM)->st_size == 0) \ + && (ADDR) == (SYM_ADDR)) \ + || (ADDR) < (SYM_ADDR) + (SYM)->st_size) \ + && (!(MATCHSYM) || MATCHSYM < (SYM_ADDR))) + /* Use this macro to convert a pointer to a function's entry point to * a pointer to function. The pointer is assumed to have already been * relocated. LOADADDR is passed because it may contain additional diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c index 68cd5797e..b80495e71 100644 --- a/ldso/libdl/libdl.c +++ b/ldso/libdl/libdl.c @@ -1067,7 +1067,11 @@ int dladdr(const void *__address, Dl_info * __info) ElfW(Addr) symbol_addr; symbol_addr = (ElfW(Addr)) DL_RELOC_ADDR(pelf->loadaddr, symtab[si].st_value); - if (symbol_addr <= (ElfW(Addr))__address && (!sf || sa < symbol_addr)) { + if ((symtab[si].st_shndx != SHN_UNDEF + || symtab[si].st_value != 0) + && ELF_ST_TYPE(symtab[si].st_info) != STT_TLS + && DL_ADDR_SYM_MATCH(symbol_addr, &symtab[si], sa, + (ElfW(Addr)) __address)) { sa = symbol_addr; sn = si; sf = 1; @@ -1083,7 +1087,11 @@ int dladdr(const void *__address, Dl_info * __info) ElfW(Addr) symbol_addr; symbol_addr = (ElfW(Addr)) DL_RELOC_ADDR(pelf->loadaddr, symtab[si].st_value); - if (symbol_addr <= (ElfW(Addr))__address && (!sf || sa < symbol_addr)) { + if ((symtab[si].st_shndx != SHN_UNDEF + || symtab[si].st_value != 0) + && ELF_ST_TYPE(symtab[si].st_info) != STT_TLS + && DL_ADDR_SYM_MATCH(symbol_addr, &symtab[si], sa, + (ElfW(Addr)) __address)) { sa = symbol_addr; sn = si; sf = 1; -- cgit v1.2.3 From 025ec197fe9d069c6d705e6f7d1509bb9dc1ce56 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Tue, 10 May 2011 20:09:36 +0200 Subject: __uc_malloc: Fix memory-leak in error path Signed-off-by: Bernhard Reutner-Fischer --- libc/stdlib/__uc_malloc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libc/stdlib/__uc_malloc.c b/libc/stdlib/__uc_malloc.c index 2a2e223ef..449f014fc 100644 --- a/libc/stdlib/__uc_malloc.c +++ b/libc/stdlib/__uc_malloc.c @@ -39,6 +39,7 @@ void *__uc_malloc(size_t size) return p; if (!__uc_malloc_failed) _exit(1); + free(p); __uc_malloc_failed(size); } } -- 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(-) 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 bfbab32be6d74de0717c7f5fbdd90edfd2839169 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Tue, 10 May 2011 21:22:25 +0200 Subject: ldso: commentary typo fix Signed-off-by: Bernhard Reutner-Fischer --- ldso/libdl/libdl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c index b80495e71..52c77b00a 100644 --- a/ldso/libdl/libdl.c +++ b/ldso/libdl/libdl.c @@ -672,7 +672,7 @@ void *dlsym(void *vhandle, const char *name) #if defined(USE_TLS) && USE_TLS && defined SHARED if (sym_ref.tpnt) { /* The found symbol is a thread-local storage variable. - Return the address for to the current thread. */ + Return its address for the current thread. */ ret = _dl_tls_symaddr ((struct link_map *)sym_ref.tpnt, (Elf32_Addr)ret); } #endif -- cgit v1.2.3 From afeef5ca3930a22b90bed7717464f117fcca78f0 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 11 May 2011 09:37:35 +0200 Subject: buildsys: Turn on strict aliasing for everyone Signed-off-by: Bernhard Reutner-Fischer --- Rules.mak | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Rules.mak b/Rules.mak index 49ca2072a..65fe47c63 100644 --- a/Rules.mak +++ b/Rules.mak @@ -186,6 +186,7 @@ OPTIMIZATION+=$(call check_gcc,-Os,-O2) OPTIMIZATION+=$(call check_gcc,-funit-at-a-time,) # shrinks code by about 0.1% OPTIMIZATION+=$(call check_gcc,-fmerge-all-constants) +OPTIMIZATION+=$(call check_gcc,-fstrict-aliasing) GCC_MAJOR_VER?=$(shell $(CC) -dumpversion | cut -d . -f 1) #GCC_MINOR_VER?=$(shell $(CC) -dumpversion | cut -d . -f 2) @@ -332,7 +333,6 @@ ifeq ($(TARGET_ARCH),sparc) endif ifeq ($(TARGET_ARCH),arm) - OPTIMIZATION+=-fstrict-aliasing CPU_CFLAGS-$(ARCH_LITTLE_ENDIAN)+=-mlittle-endian CPU_CFLAGS-$(ARCH_BIG_ENDIAN)+=-mbig-endian CPU_CFLAGS-$(CONFIG_GENERIC_ARM)+= @@ -385,7 +385,6 @@ ifeq ($(TARGET_ARCH),nios) endif ifeq ($(TARGET_ARCH),sh) - OPTIMIZATION+=-fstrict-aliasing OPTIMIZATION+= $(call check_gcc,-mprefergot,) CPU_CFLAGS-$(ARCH_LITTLE_ENDIAN)+=-ml CPU_CFLAGS-$(ARCH_BIG_ENDIAN)+=-mb @@ -401,7 +400,6 @@ endif endif ifeq ($(TARGET_ARCH),sh64) - OPTIMIZATION+=-fstrict-aliasing CPU_CFLAGS-$(ARCH_LITTLE_ENDIAN):=-ml CPU_CFLAGS-$(ARCH_BIG_ENDIAN):=-mb CPU_CFLAGS-$(CONFIG_SH5)+=-m5-32media @@ -546,10 +544,10 @@ endif endif # Add a bunch of extra pedantic annoyingly strict checks -XWARNINGS=$(call qstrip,$(WARNINGS)) +XWARNINGS=$(call qstrip,$(WARNINGS)) XWARNINGS+=$(foreach w,\ -Wstrict-prototypes \ - -fno-strict-aliasing \ + -Wstrict-aliasing \ , $(call check_gcc,$(w),)) ifeq ($(EXTRA_WARNINGS),y) XWARNINGS+=$(foreach w,\ -- cgit v1.2.3 From 7a080cd149c7b25d415d76506510d55b34819fc2 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Fri, 6 May 2011 19:07:12 +0200 Subject: libubacktrace: fix config-symbol handling Config symbals that are not set are empty, not 'n'. --- libubacktrace/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libubacktrace/Makefile.in b/libubacktrace/Makefile.in index f75f68b75..e2a4cb64f 100644 --- a/libubacktrace/Makefile.in +++ b/libubacktrace/Makefile.in @@ -45,7 +45,7 @@ lib-so-$(UCLIBC_HAS_BACKTRACE) += $(top_builddir)lib/libubacktrace.so objclean-y += CLEAN_libubacktrace -ifeq ($(DOMULTI),n) +ifeq ($(DOMULTI),) ifeq ($(DOPIC),y) $(top_builddir)lib/libubacktrace.so: $(top_builddir)lib/libubacktrace.a $(libdl.depend) else -- cgit v1.2.3 From 46e3df937b05fa291470e975cd836c5435aa0ecc Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Wed, 11 May 2011 08:40:58 +0200 Subject: Implement accept4 system call. Signed-off-by: Thierry Reding Signed-off-by: Bernhard Reutner-Fischer --- libc/inet/accept.c | 1 + libc/inet/socketcalls.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/libc/inet/accept.c b/libc/inet/accept.c index 0217a6876..b0fd2b2c6 100644 --- a/libc/inet/accept.c +++ b/libc/inet/accept.c @@ -5,4 +5,5 @@ */ #define L_accept +#define L_accept4 #include "socketcalls.c" diff --git a/libc/inet/socketcalls.c b/libc/inet/socketcalls.c index 42a5a563f..ff5fdaa30 100644 --- a/libc/inet/socketcalls.c +++ b/libc/inet/socketcalls.c @@ -31,6 +31,7 @@ extern int __socketcall(int call, unsigned long *args) attribute_hidden; #define SYS_GETSOCKOPT 15 #define SYS_SENDMSG 16 #define SYS_RECVMSG 17 +#define SYS_ACCEPT4 18 #endif #ifdef __UCLIBC_HAS_THREADS_NATIVE__ @@ -560,3 +561,20 @@ int socketpair(int family, int type, int protocol, int sockvec[2]) } #endif #endif + +#ifdef L_accept4 +#ifdef __NR_accept4 +_syscall4(int, accept4, int, sockfd, struct sockaddr *, addr, socklen_t *, addrlen, int, flags) +#elif defined(__NR_socketcall) +int accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags) +{ + unsigned long args[4]; + + args[0] = sockfd; + args[1] = (unsigned long) addr; + args[2] = (unsigned long) addrlen; + args[3] = flags; + return __socketcall(SYS_ACCEPT4, args); +} +#endif +#endif -- 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 --- include/sys/socket.h | 9 ++++ libc/inet/Makefile.in | 6 ++- libc/inet/accept.c | 1 - libc/inet/accept4.c | 8 ++++ libc/inet/socketcalls.c | 56 +++++++++++++++++------- libc/sysdeps/linux/common/bits/kernel-features.h | 12 +++++ libc/sysdeps/linux/common/stubs.c | 4 ++ 7 files changed, 77 insertions(+), 19 deletions(-) create mode 100644 libc/inet/accept4.c diff --git a/include/sys/socket.h b/include/sys/socket.h index 0824fc855..5d38f1105 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -227,6 +227,15 @@ extern int accept (int __fd, __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len); libc_hidden_proto(accept) +#ifdef __USE_GNU +/* Similar to 'accept' but takes an additional parameter to specify flags. + + This function is a cancellation point and therefore not marked with + __THROW. */ +extern int accept4 (int __fd, __SOCKADDR_ARG __addr, + socklen_t *__restrict __addr_len, int __flags); +#endif + /* Shut down all or part of the connection open on socket FD. HOW determines what to shut down: SHUT_RD = No more receptions; diff --git a/libc/inet/Makefile.in b/libc/inet/Makefile.in index abcf2f7d7..c490adf7e 100644 --- a/libc/inet/Makefile.in +++ b/libc/inet/Makefile.in @@ -44,11 +44,13 @@ CSRC-$(findstring y,$(UCLIBC_HAS_IPV4)$(UCLIBC_HAS_IPV6)) += \ ## CSRC-y += encodep.c decodep.c formquery.c # multi source socketcalls.c -socketcalls_CSRC += \ +socketcalls_CSRC-y += \ accept.c bind.c connect.c getpeername.c getsockname.c \ getsockopt.c listen.c recv.c recvfrom.c recvmsg.c send.c sendmsg.c \ sendto.c setsockopt.c shutdown.c socket.c socketpair.c -CSRC-$(UCLIBC_HAS_SOCKET) += $(socketcalls_CSRC) opensock.c +# FIXME: GNU / linux specific +socketcalls_CSRC-y += accept4.c +CSRC-$(UCLIBC_HAS_SOCKET) += $(socketcalls_CSRC-y) opensock.c CSRC-$(findstring y,$(UCLIBC_HAS_SOCKET)$(UCLIBC_HAS_IPV4)$(UCLIBC_HAS_IPV6)) += ethers.c ether_addr.c diff --git a/libc/inet/accept.c b/libc/inet/accept.c index b0fd2b2c6..0217a6876 100644 --- a/libc/inet/accept.c +++ b/libc/inet/accept.c @@ -5,5 +5,4 @@ */ #define L_accept -#define L_accept4 #include "socketcalls.c" diff --git a/libc/inet/accept4.c b/libc/inet/accept4.c new file mode 100644 index 000000000..e2fdd6c2f --- /dev/null +++ b/libc/inet/accept4.c @@ -0,0 +1,8 @@ +/* + * Copyright (C) 2000-2006 Erik Andersen + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#define L_accept4 +#include "socketcalls.c" diff --git a/libc/inet/socketcalls.c b/libc/inet/socketcalls.c index ff5fdaa30..aae7e93bf 100644 --- a/libc/inet/socketcalls.c +++ b/libc/inet/socketcalls.c @@ -83,6 +83,46 @@ weak_alias(__libc_accept,accept) libc_hidden_weak(accept) #endif +#ifdef L_accept4 +#ifdef __NR_accept4 +# define __NR___sys_accept4 __NR_accept4 +static _syscall4(int, __sys_accept4, int, fd, struct sockaddr *, addr, socklen_t *, addrlen, int, flags) +int accept4(int fd, struct sockaddr *addr, socklen_t * addrlen, int flags) +{ + if (SINGLE_THREAD_P) + return __sys_accept4(fd, addr, addrlen, flags); +#ifdef __UCLIBC_HAS_THREADS_NATIVE__ + else { + int oldtype = LIBC_CANCEL_ASYNC (); + int result = __sys_accept4(fd, addr, addrlen, flags); + LIBC_CANCEL_RESET (oldtype); + return result; + } +#endif +} +#elif defined(__NR_socketcall) +int accept4(int fd, struct sockaddr *addr, socklen_t *addrlen, int flags) +{ + unsigned long args[4]; + + args[0] = fd; + args[1] = (unsigned long) addr; + args[2] = (unsigned long) addrlen; + args[3] = flags; + if (SINGLE_THREAD_P) + return __socketcall(SYS_ACCEPT4, args); +#ifdef __UCLIBC_HAS_THREADS_NATIVE__ + else { + int oldtype = LIBC_CANCEL_ASYNC (); + int result = __socketcall(SYS_ACCEPT4, args); + LIBC_CANCEL_RESET (oldtype); + return result; + } +#endif +} +#endif +#endif + #ifdef L_bind #ifdef __NR_bind _syscall3(int, bind, int, sockfd, const struct sockaddr *, myaddr, socklen_t, addrlen) @@ -562,19 +602,3 @@ int socketpair(int family, int type, int protocol, int sockvec[2]) #endif #endif -#ifdef L_accept4 -#ifdef __NR_accept4 -_syscall4(int, accept4, int, sockfd, struct sockaddr *, addr, socklen_t *, addrlen, int, flags) -#elif defined(__NR_socketcall) -int accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags) -{ - unsigned long args[4]; - - args[0] = sockfd; - args[1] = (unsigned long) addr; - args[2] = (unsigned long) addrlen; - args[3] = flags; - return __socketcall(SYS_ACCEPT4, args); -} -#endif -#endif 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(+) 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 --- extra/Configs/Config.in | 3 ++- include/unistd.h | 7 +++++++ 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 ++++++++ 6 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 libc/sysdeps/linux/common/pipe2.c diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in index 147a316e6..7dffdeab9 100644 --- a/extra/Configs/Config.in +++ b/extra/Configs/Config.in @@ -915,7 +915,8 @@ config UCLIBC_LINUX_SPECIFIC default y help capget(), capset(), fstatfs(), inotify_*(), ioperm(), iopl(), - madvise(), modify_ldt(), personality(), prctl()/arch_prctl(), + madvise(), modify_ldt(), pipe2(), personality(), + prctl()/arch_prctl(), ppoll(), readahead(), reboot(), remap_file_pages(), sched_getaffinity(), sched_setaffinity(), sendfile(), setfsgid(), setfsuid(), setresuid(), diff --git a/include/unistd.h b/include/unistd.h index c421cb308..6b614dd05 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -389,6 +389,13 @@ extern ssize_t pwrite64 (int __fd, __const void *__buf, size_t __n, extern int pipe (int __pipedes[2]) __THROW __wur; libc_hidden_proto(pipe) +#ifdef __USE_GNU +/* Same as pipe but apply flags passed in FLAGS to the new file + descriptors. */ +extern int pipe2 (int __pipedes[2], int __flags) __THROW __wur; +libc_hidden_proto(pipe2) +#endif + /* Schedule an alarm. In SECONDS seconds, the process will get a SIGALRM. If SECONDS is zero, any currently scheduled alarm will be cancelled. The function returns the number of seconds remaining until the last 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 bbb07be58509856b4629d7b2a4aa09dbddcb6828 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 11 May 2011 19:16:17 +0200 Subject: Revert "libubacktrace: fix config-symbol handling" This reverts commit 7a080cd149c7b25d415d76506510d55b34819fc2. This symbol is in fact different (as it is set no 'n'). --- libubacktrace/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libubacktrace/Makefile.in b/libubacktrace/Makefile.in index e2a4cb64f..f75f68b75 100644 --- a/libubacktrace/Makefile.in +++ b/libubacktrace/Makefile.in @@ -45,7 +45,7 @@ lib-so-$(UCLIBC_HAS_BACKTRACE) += $(top_builddir)lib/libubacktrace.so objclean-y += CLEAN_libubacktrace -ifeq ($(DOMULTI),) +ifeq ($(DOMULTI),n) ifeq ($(DOPIC),y) $(top_builddir)lib/libubacktrace.so: $(top_builddir)lib/libubacktrace.a $(libdl.depend) else -- cgit v1.2.3 From 7d8c08baf43d27aac22a29e55c1108f31b8d7595 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 11 May 2011 19:52:16 +0200 Subject: libubacktrace: mv unwind.h to include Fixes compilation if NPTL is off. I hope this doesn't break ARM EABI but cannot check ATM. Signed-off-by: Bernhard Reutner-Fischer --- include/unwind.h | 220 +++++++++++++++++++++++++++++++ libpthread/nptl/sysdeps/generic/unwind.h | 220 ------------------------------- 2 files changed, 220 insertions(+), 220 deletions(-) create mode 100644 include/unwind.h delete mode 100644 libpthread/nptl/sysdeps/generic/unwind.h diff --git a/include/unwind.h b/include/unwind.h new file mode 100644 index 000000000..81fc4db55 --- /dev/null +++ b/include/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 diff