Skip to content

Commit

Permalink
Let all .c and .S files under lib/csu consistently use the __FBSDID()
Browse files Browse the repository at this point in the history
macro for identification, instead of several different hand-rolled
variants (plain .ident, .ascii, etc).
  • Loading branch information
DimitryAndric committed Dec 9, 2010
1 parent 3d43bf4 commit 12dd9eb
Show file tree
Hide file tree
Showing 21 changed files with 61 additions and 50 deletions.
5 changes: 3 additions & 2 deletions lib/csu/amd64/crt1.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");

#ifndef lint
#ifndef __GNUC__
#error "GCC is needed to compile this file"
Expand Down Expand Up @@ -92,5 +95,3 @@ __asm__("eprol:");
_init();
exit( main(argc, argv, env) );
}

__asm__(".ident\t\"$FreeBSD$\"");
6 changes: 3 additions & 3 deletions lib/csu/amd64/crti.S
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <machine/asm.h>
__FBSDID("$FreeBSD$");

.section .init,"ax",@progbits
.align 4
.globl _init
Expand All @@ -36,6 +39,3 @@ _init:
.type _fini,@function
_fini:
subq $8,%rsp

.section .rodata
.ascii "$FreeBSD$\0"
6 changes: 3 additions & 3 deletions lib/csu/amd64/crtn.S
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <machine/asm.h>
__FBSDID("$FreeBSD$");

.section .init,"ax",@progbits
addq $8,%rsp
ret

.section .fini,"ax",@progbits
addq $8,%rsp
ret

.section .rodata
.ascii "$FreeBSD$\0"
6 changes: 3 additions & 3 deletions lib/csu/arm/crt1.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");

#ifndef lint
#ifndef __GNUC__
#error "GCC is needed to compile this file"
Expand All @@ -49,7 +52,6 @@

#include "libc_private.h"
#include "crtbrand.c"
#include <machine/asm.h>

struct Struct_Obj_Entry;
struct ps_strings;
Expand Down Expand Up @@ -136,5 +138,3 @@ __asm__(".text");
__asm__("eprol:");
__asm__(".previous");
#endif

__asm__(".ident\t\"$FreeBSD$\"");
1 change: 1 addition & 0 deletions lib/csu/arm/crtn.S
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <machine/asm.h>
__FBSDID("$FreeBSD$");

.section .init,"ax",%progbits
ldmea fp, {fp, sp, pc}
mov pc, lr
Expand Down
3 changes: 3 additions & 0 deletions lib/csu/i386-elf/crt1_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
* $FreeBSD$
*/

#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");

#ifndef lint
#ifndef __GNUC__
#error "GCC is needed to compile this file"
Expand Down
4 changes: 2 additions & 2 deletions lib/csu/i386-elf/crt1_s.S
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
* $FreeBSD$
*/

#include <machine/asm.h>
__FBSDID("$FreeBSD$");

.text
.align 4
Expand All @@ -47,5 +49,3 @@ _start:
int3
.cfi_endproc
.size _start, . - _start

.ident "$FreeBSD$"
6 changes: 3 additions & 3 deletions lib/csu/i386-elf/crti.S
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <machine/asm.h>
__FBSDID("$FreeBSD$");

.section .init,"ax",@progbits
.align 4
.globl _init
Expand All @@ -36,6 +39,3 @@ _init:
.type _fini,@function
_fini:
sub $12,%esp /* re-align stack pointer */

.section .rodata
.ascii "$FreeBSD$\0"
6 changes: 3 additions & 3 deletions lib/csu/i386-elf/crtn.S
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <machine/asm.h>
__FBSDID("$FreeBSD$");

.section .init,"ax",@progbits
add $12,%esp
ret

.section .fini,"ax",@progbits
add $12,%esp
ret

.section .rodata
.ascii "$FreeBSD$\0"
3 changes: 2 additions & 1 deletion lib/csu/ia64/crt1.S
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

.ident "$FreeBSD$"
#include <machine/asm.h>
__FBSDID("$FreeBSD$");

.text

Expand Down
3 changes: 3 additions & 0 deletions lib/csu/ia64/crti.S
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
* $FreeBSD$
*/

#include <machine/asm.h>
__FBSDID("$FreeBSD$");

/*
* This file (and its companion crtn.S) form the terminators of the
* .init and .fini sections.
Expand Down
3 changes: 3 additions & 0 deletions lib/csu/ia64/crtn.S
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
* $FreeBSD$
*/

#include <machine/asm.h>
__FBSDID("$FreeBSD$");

.file "crtn.S"

.section .init,"ax",@progbits
Expand Down
5 changes: 3 additions & 2 deletions lib/csu/powerpc/crt1.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");

#ifndef lint
#ifndef __GNUC__
#error "GCC is needed to compile this file"
Expand Down Expand Up @@ -120,5 +123,3 @@ __asm__(".text");
__asm__("eprol:");
__asm__(".previous");
#endif

__asm__(".ident\t\"$FreeBSD$\"");
9 changes: 4 additions & 5 deletions lib/csu/powerpc/crti.S
Original file line number Diff line number Diff line change
Expand Up @@ -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 <machine/asm.h>
__FBSDID("$FreeBSD$");

.section .init,"ax",@progbits
.align 2
.globl _init
Expand All @@ -44,7 +47,3 @@ _fini:
stw 31,12(1)
stw 0,20(1)
mr 31,1


.section .rodata
.ascii "$FreeBSD$\0"
7 changes: 3 additions & 4 deletions lib/csu/powerpc/crtn.S
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <machine/asm.h>
__FBSDID("$FreeBSD$");

.section .init,"ax",@progbits
lwz 11,0(1)
lwz 0,4(11)
Expand All @@ -39,7 +42,3 @@
lwz 31,-4(11)
mr 1,11
blr


.section .rodata
.ascii "$FreeBSD$\0"
5 changes: 3 additions & 2 deletions lib/csu/powerpc64/crt1.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");

#ifndef lint
#ifndef __GNUC__
#error "GCC is needed to compile this file"
Expand Down Expand Up @@ -119,5 +122,3 @@ __asm__(".text");
__asm__("eprol:");
__asm__(".previous");
#endif

__asm__(".ident\t\"$FreeBSD$\"");
8 changes: 4 additions & 4 deletions lib/csu/powerpc64/crti.S
Original file line number Diff line number Diff line change
Expand Up @@ -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 <machine/asm.h>
__FBSDID("$FreeBSD$");

.section .init,"ax",@progbits
.align 2
.globl _init
Expand Down Expand Up @@ -56,6 +59,3 @@ _fini:
stdu 1,-48(1)
mflr 0
std 0,64(1)

.section .rodata
.ascii "$FreeBSD$\0"
7 changes: 3 additions & 4 deletions lib/csu/powerpc64/crtn.S
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <machine/asm.h>
__FBSDID("$FreeBSD$");

.section .init,"ax",@progbits
ld %r1,0(%r1)
ld 0,16(%r1)
Expand All @@ -35,7 +38,3 @@
ld 0,16(%r1)
mtlr 0
blr


.section .rodata
.ascii "$FreeBSD$\0"
5 changes: 3 additions & 2 deletions lib/csu/sparc64/crt1.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");

#ifndef lint
#ifndef __GNUC__
#error "GCC is needed to compile this file"
Expand Down Expand Up @@ -121,5 +124,3 @@ __asm__(".text");
__asm__("eprol:");
__asm__(".previous");
#endif

__asm__(".ident\t\"$FreeBSD$\"");
7 changes: 3 additions & 4 deletions lib/csu/sparc64/crti.S
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <machine/asm.h>
__FBSDID("$FreeBSD$");

.file "crti.S"

/* The minimum stack frame size (bytes) is:
Expand All @@ -52,7 +55,3 @@ _init:
.align 4
_fini:
save %sp,-192,%sp


.section .rodata
.ascii "$FreeBSD$\0"
6 changes: 3 additions & 3 deletions lib/csu/sparc64/crtn.S
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <machine/asm.h>
__FBSDID("$FreeBSD$");

.file "crtn.S"

.section .init,"ax",@progbits
Expand All @@ -37,6 +40,3 @@
.align 4
ret
restore

.section .rodata
.ascii "$FreeBSD$\0"

0 comments on commit 12dd9eb

Please sign in to comment.