From cbbcfbf8b769db75e99f7423e6d4ed6f8b7eb5ea Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Thu, 9 Dec 2010 21:31:21 +0000 Subject: [PATCH] Let all .c and .S files under lib/csu consistently use the __FBSDID() macro for identification, instead of several different hand-rolled variants (plain .ident, .ascii, etc). --- lib/csu/amd64/crt1.c | 5 +++-- lib/csu/amd64/crti.S | 6 +++--- lib/csu/amd64/crtn.S | 6 +++--- lib/csu/arm/crt1.c | 6 +++--- lib/csu/arm/crtn.S | 1 + lib/csu/i386-elf/crt1_c.c | 3 +++ lib/csu/i386-elf/crt1_s.S | 4 ++-- lib/csu/i386-elf/crti.S | 6 +++--- lib/csu/i386-elf/crtn.S | 6 +++--- lib/csu/ia64/crt1.S | 3 ++- lib/csu/ia64/crti.S | 3 +++ lib/csu/ia64/crtn.S | 3 +++ lib/csu/powerpc/crt1.c | 5 +++-- lib/csu/powerpc/crti.S | 9 ++++----- lib/csu/powerpc/crtn.S | 7 +++---- lib/csu/powerpc64/crt1.c | 5 +++-- lib/csu/powerpc64/crti.S | 8 ++++---- lib/csu/powerpc64/crtn.S | 7 +++---- lib/csu/sparc64/crt1.c | 5 +++-- lib/csu/sparc64/crti.S | 7 +++---- lib/csu/sparc64/crtn.S | 6 +++--- 21 files changed, 61 insertions(+), 50 deletions(-) diff --git a/lib/csu/amd64/crt1.c b/lib/csu/amd64/crt1.c index 3bc4809755a5..998477aafd0c 100644 --- a/lib/csu/amd64/crt1.c +++ b/lib/csu/amd64/crt1.c @@ -24,6 +24,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #ifndef lint #ifndef __GNUC__ #error "GCC is needed to compile this file" @@ -92,5 +95,3 @@ __asm__("eprol:"); _init(); exit( main(argc, argv, env) ); } - -__asm__(".ident\t\"$FreeBSD$\""); diff --git a/lib/csu/amd64/crti.S b/lib/csu/amd64/crti.S index c46f00101916..37698ba490e1 100644 --- a/lib/csu/amd64/crti.S +++ b/lib/csu/amd64/crti.S @@ -23,6 +23,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + .section .init,"ax",@progbits .align 4 .globl _init @@ -36,6 +39,3 @@ _init: .type _fini,@function _fini: subq $8,%rsp - - .section .rodata -.ascii "$FreeBSD$\0" diff --git a/lib/csu/amd64/crtn.S b/lib/csu/amd64/crtn.S index d6d09dabeb21..eb6d4df74cd9 100644 --- a/lib/csu/amd64/crtn.S +++ b/lib/csu/amd64/crtn.S @@ -23,6 +23,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + .section .init,"ax",@progbits addq $8,%rsp ret @@ -30,6 +33,3 @@ .section .fini,"ax",@progbits addq $8,%rsp ret - - .section .rodata -.ascii "$FreeBSD$\0" diff --git a/lib/csu/arm/crt1.c b/lib/csu/arm/crt1.c index 4319f178cc3e..f2d4dbf8aae0 100644 --- a/lib/csu/arm/crt1.c +++ b/lib/csu/arm/crt1.c @@ -39,6 +39,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #ifndef lint #ifndef __GNUC__ #error "GCC is needed to compile this file" @@ -49,7 +52,6 @@ #include "libc_private.h" #include "crtbrand.c" -#include struct Struct_Obj_Entry; struct ps_strings; @@ -136,5 +138,3 @@ __asm__(".text"); __asm__("eprol:"); __asm__(".previous"); #endif - -__asm__(".ident\t\"$FreeBSD$\""); diff --git a/lib/csu/arm/crtn.S b/lib/csu/arm/crtn.S index d148b1eb0965..962f0edde3d6 100644 --- a/lib/csu/arm/crtn.S +++ b/lib/csu/arm/crtn.S @@ -1,5 +1,6 @@ #include __FBSDID("$FreeBSD$"); + .section .init,"ax",%progbits ldmea fp, {fp, sp, pc} mov pc, lr diff --git a/lib/csu/i386-elf/crt1_c.c b/lib/csu/i386-elf/crt1_c.c index c38f267c8e36..1eadc7c01c08 100644 --- a/lib/csu/i386-elf/crt1_c.c +++ b/lib/csu/i386-elf/crt1_c.c @@ -26,6 +26,9 @@ * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + #ifndef lint #ifndef __GNUC__ #error "GCC is needed to compile this file" diff --git a/lib/csu/i386-elf/crt1_s.S b/lib/csu/i386-elf/crt1_s.S index 949d16411423..f8c1d73b605f 100644 --- a/lib/csu/i386-elf/crt1_s.S +++ b/lib/csu/i386-elf/crt1_s.S @@ -25,6 +25,8 @@ * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); .text .align 4 @@ -47,5 +49,3 @@ _start: int3 .cfi_endproc .size _start, . - _start - - .ident "$FreeBSD$" diff --git a/lib/csu/i386-elf/crti.S b/lib/csu/i386-elf/crti.S index bb11f3ac718d..608dc210748d 100644 --- a/lib/csu/i386-elf/crti.S +++ b/lib/csu/i386-elf/crti.S @@ -23,6 +23,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + .section .init,"ax",@progbits .align 4 .globl _init @@ -36,6 +39,3 @@ _init: .type _fini,@function _fini: sub $12,%esp /* re-align stack pointer */ - - .section .rodata -.ascii "$FreeBSD$\0" diff --git a/lib/csu/i386-elf/crtn.S b/lib/csu/i386-elf/crtn.S index bc90d31d7c13..9ce5becaf350 100644 --- a/lib/csu/i386-elf/crtn.S +++ b/lib/csu/i386-elf/crtn.S @@ -23,6 +23,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + .section .init,"ax",@progbits add $12,%esp ret @@ -30,6 +33,3 @@ .section .fini,"ax",@progbits add $12,%esp ret - - .section .rodata -.ascii "$FreeBSD$\0" diff --git a/lib/csu/ia64/crt1.S b/lib/csu/ia64/crt1.S index 10e1a63d17b4..6ff9cd9171ae 100644 --- a/lib/csu/ia64/crt1.S +++ b/lib/csu/ia64/crt1.S @@ -24,7 +24,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - .ident "$FreeBSD$" +#include +__FBSDID("$FreeBSD$"); .text diff --git a/lib/csu/ia64/crti.S b/lib/csu/ia64/crti.S index 1314cb3a5b2c..66ef94849924 100644 --- a/lib/csu/ia64/crti.S +++ b/lib/csu/ia64/crti.S @@ -26,6 +26,9 @@ * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + /* * This file (and its companion crtn.S) form the terminators of the * .init and .fini sections. diff --git a/lib/csu/ia64/crtn.S b/lib/csu/ia64/crtn.S index 26d40d3291c9..681fba38c9b2 100644 --- a/lib/csu/ia64/crtn.S +++ b/lib/csu/ia64/crtn.S @@ -26,6 +26,9 @@ * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + .file "crtn.S" .section .init,"ax",@progbits diff --git a/lib/csu/powerpc/crt1.c b/lib/csu/powerpc/crt1.c index 3a2f6dd979b3..67de2f5d6f42 100644 --- a/lib/csu/powerpc/crt1.c +++ b/lib/csu/powerpc/crt1.c @@ -39,6 +39,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #ifndef lint #ifndef __GNUC__ #error "GCC is needed to compile this file" @@ -120,5 +123,3 @@ __asm__(".text"); __asm__("eprol:"); __asm__(".previous"); #endif - -__asm__(".ident\t\"$FreeBSD$\""); diff --git a/lib/csu/powerpc/crti.S b/lib/csu/powerpc/crti.S index 75d4345cad2d..544bfa9ae569 100644 --- a/lib/csu/powerpc/crti.S +++ b/lib/csu/powerpc/crti.S @@ -22,7 +22,10 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - + +#include +__FBSDID("$FreeBSD$"); + .section .init,"ax",@progbits .align 2 .globl _init @@ -44,7 +47,3 @@ _fini: stw 31,12(1) stw 0,20(1) mr 31,1 - - - .section .rodata -.ascii "$FreeBSD$\0" diff --git a/lib/csu/powerpc/crtn.S b/lib/csu/powerpc/crtn.S index 80735cc3a8ab..d3baa70876bd 100644 --- a/lib/csu/powerpc/crtn.S +++ b/lib/csu/powerpc/crtn.S @@ -23,6 +23,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + .section .init,"ax",@progbits lwz 11,0(1) lwz 0,4(11) @@ -39,7 +42,3 @@ lwz 31,-4(11) mr 1,11 blr - - - .section .rodata -.ascii "$FreeBSD$\0" diff --git a/lib/csu/powerpc64/crt1.c b/lib/csu/powerpc64/crt1.c index 080691c57ccf..080bd4d54d28 100644 --- a/lib/csu/powerpc64/crt1.c +++ b/lib/csu/powerpc64/crt1.c @@ -39,6 +39,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #ifndef lint #ifndef __GNUC__ #error "GCC is needed to compile this file" @@ -119,5 +122,3 @@ __asm__(".text"); __asm__("eprol:"); __asm__(".previous"); #endif - -__asm__(".ident\t\"$FreeBSD$\""); diff --git a/lib/csu/powerpc64/crti.S b/lib/csu/powerpc64/crti.S index 4118765646eb..edca7ba77b78 100644 --- a/lib/csu/powerpc64/crti.S +++ b/lib/csu/powerpc64/crti.S @@ -22,7 +22,10 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - + +#include +__FBSDID("$FreeBSD$"); + .section .init,"ax",@progbits .align 2 .globl _init @@ -56,6 +59,3 @@ _fini: stdu 1,-48(1) mflr 0 std 0,64(1) - - .section .rodata -.ascii "$FreeBSD$\0" diff --git a/lib/csu/powerpc64/crtn.S b/lib/csu/powerpc64/crtn.S index 42ca0835dc49..c62f913d9296 100644 --- a/lib/csu/powerpc64/crtn.S +++ b/lib/csu/powerpc64/crtn.S @@ -23,6 +23,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + .section .init,"ax",@progbits ld %r1,0(%r1) ld 0,16(%r1) @@ -35,7 +38,3 @@ ld 0,16(%r1) mtlr 0 blr - - - .section .rodata -.ascii "$FreeBSD$\0" diff --git a/lib/csu/sparc64/crt1.c b/lib/csu/sparc64/crt1.c index f27c59b6f628..3593c956520b 100644 --- a/lib/csu/sparc64/crt1.c +++ b/lib/csu/sparc64/crt1.c @@ -30,6 +30,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #ifndef lint #ifndef __GNUC__ #error "GCC is needed to compile this file" @@ -121,5 +124,3 @@ __asm__(".text"); __asm__("eprol:"); __asm__(".previous"); #endif - -__asm__(".ident\t\"$FreeBSD$\""); diff --git a/lib/csu/sparc64/crti.S b/lib/csu/sparc64/crti.S index e3e81af18cc9..9e529a5ac471 100644 --- a/lib/csu/sparc64/crti.S +++ b/lib/csu/sparc64/crti.S @@ -26,6 +26,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + .file "crti.S" /* The minimum stack frame size (bytes) is: @@ -52,7 +55,3 @@ _init: .align 4 _fini: save %sp,-192,%sp - - - .section .rodata -.ascii "$FreeBSD$\0" diff --git a/lib/csu/sparc64/crtn.S b/lib/csu/sparc64/crtn.S index 7c0d1605393d..5b6d4a77abc1 100644 --- a/lib/csu/sparc64/crtn.S +++ b/lib/csu/sparc64/crtn.S @@ -26,6 +26,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + .file "crtn.S" .section .init,"ax",@progbits @@ -37,6 +40,3 @@ .align 4 ret restore - - .section .rodata -.ascii "$FreeBSD$\0"