Browse Source

--- Merging r20172 into '.':
U rtl/freebsd/i386/cprt0.as
U rtl/freebsd/i386/identpatch.sh
--- Merging r20173 into '.':
U rtl/freebsd/x86_64/cprt0.as

# revisions: 20172,20173
------------------------------------------------------------------------
r20172 | marco | 2012-01-25 14:46:58 +0100 (Wed, 25 Jan 2012) | 2 lines
Changed paths:
M /trunk/rtl/freebsd/i386/cprt0.as
M /trunk/rtl/freebsd/i386/identpatch.sh

* cleanup ELF ABI tag a bit. Set abitag version to 9.0 for now.

------------------------------------------------------------------------
------------------------------------------------------------------------
r20173 | marco | 2012-01-25 14:47:22 +0100 (Wed, 25 Jan 2012) | 2 lines
Changed paths:
M /trunk/rtl/freebsd/x86_64/cprt0.as

* belongs to last commit, x86_64 part

------------------------------------------------------------------------

git-svn-id: branches/fixes_2_6@20183 -

marco 13 years ago
parent
commit
99b28fab1e
3 changed files with 44 additions and 13 deletions
  1. 11 10
      rtl/freebsd/i386/cprt0.as
  2. 1 1
      rtl/freebsd/i386/identpatch.sh
  3. 32 2
      rtl/freebsd/x86_64/cprt0.as

+ 11 - 10
rtl/freebsd/i386/cprt0.as

@@ -13,24 +13,25 @@
 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 #
 #**********************************************************************}
-#
+
 # FreeBSD  ELF startup code for Free Pascal for dynamical linking to libc.
 #
-# To avoid needing a "COMPAT" system, patch this file to change the number 
-# according to what is retured by the "file" command on a normal binary:
+# To avoid needing a "COMPAT" system, patch the constant following the 
+# "FreeBSD" field in the abitag to the relevant ABI number 
+# Some versions of the "file" command support
+# visualizing this constant. If not use elfdump, or patch 
+# automatically using the ../i386/identpatch.sh script
 #
-# `file gcc` gives
+# some typical values: 
 #
-# gcc: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), for 
-# FreeBSD 7.0 ($IDVERSION), statically linked, FreeBSD-style, stripped
-# 
 # freebsd 5.4 504000
 # freebsd 6.3 (prerelease) : 603100
 # freebsd 7.0 700055
-#
+# freebsd 8.0 800500  (-stable)
+# FreeBSD 9.0 900044
 
         .file   "cprt0.as"
-        .ident  "FreePascal 2.2.x series dynlinked to libc"
+        .ident  "FreePascal 2.6.x/2.7.x series dynlinked to libc"
 .section        .note.ABI-tag,"a",@progbits
         .p2align 2
         .type   abitag, @object
@@ -40,7 +41,7 @@ abitag:
         .long   4
         .long   1
         .string "FreeBSD"
-        .long   504000
+        .long   900044
         .section	.rodata.str1.1,"aMS",@progbits,1
 .LC0:
         .string ""

+ 1 - 1
rtl/freebsd/i386/identpatch.sh

@@ -4,4 +4,4 @@ IDVERSION=`cat elfversion`
 rm elfversion
 echo Patching cprt0.as with version $IDVERSION
 
-sed -I.sav -es/504000/$IDVERSION/ cprt0.as
+sed -I.sav -es/900044/$IDVERSION/ cprt0.as

+ 32 - 2
rtl/freebsd/x86_64/cprt0.as

@@ -1,6 +1,36 @@
+#
+#   This file is part of the Free Pascal run time library.
+#   Copyright (c) 1999-2000 by Marco van de Voort, Pierre Mueller
+#   members of the Free Pascal development team.
+#
+#   See the file COPYING.FPC, included in this distribution,
+#   for details about the copyright.
+#
+#   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.
+#
+#**********************************************************************}
+#
+# FreeBSD  ELF startup code for Free Pascal for dynamical linking to libc.
+#
+# To avoid needing a "COMPAT" system, patch the constant following the 
+# "FreeBSD" field in the abitag to the relevant ABI number 
+# Some versions of the "file" command support
+# visualizing this constant. If not use elfdump, or patch 
+# automatically using the ../i386/identpatch.sh script
+#
+# some typical values: 
+#
+# freebsd 5.4 504000
+# freebsd 6.3 (prerelease) : 603100
+# freebsd 7.0 700055
+# freebsd 8.0 800500  (-stable)
+# FreeBSD 9.0 900044
+
 	.file	"crt1.c"
 #APP
-	.ident	"$FreeBSD: src/lib/csu/common/crtbrand.c,v 1.4.20.1 2007/12/06 13:43:43 kib Exp $"
+        .ident  "FreePascal 2.6.x/2.7.x series dynlinked to libc"
 #NO_APP
 	.section	.note.ABI-tag,"a",@progbits
 	.align 4
@@ -11,7 +41,7 @@ abitag:
 	.long	4
 	.long	1
 	.string	"FreeBSD"
-	.long	700055
+	.long	900044
 .globl __progname
 	.section	.rodata
 .LC0: