Browse Source

* added somes comments to cprt0.as
script to patch cprt0.as to current .note abi id. (run on target!)

git-svn-id: trunk@11143 -

marco 17 years ago
parent
commit
1d9b04bda9
3 changed files with 21 additions and 1 deletions
  1. 1 0
      .gitattributes
  2. 13 1
      rtl/freebsd/i386/cprt0.as
  3. 7 0
      rtl/freebsd/i386/identpatch.sh

+ 1 - 0
.gitattributes

@@ -5053,6 +5053,7 @@ rtl/freebsd/freebsd.pas -text
 rtl/freebsd/i386/bsyscall.inc svneol=native#text/plain
 rtl/freebsd/i386/bsyscall.inc svneol=native#text/plain
 rtl/freebsd/i386/cprt0.as svneol=native#text/plain
 rtl/freebsd/i386/cprt0.as svneol=native#text/plain
 rtl/freebsd/i386/gprt0.as svneol=native#text/plain
 rtl/freebsd/i386/gprt0.as svneol=native#text/plain
+rtl/freebsd/i386/identpatch.sh svneol=native#text/plain
 rtl/freebsd/i386/prt0.as svneol=native#text/plain
 rtl/freebsd/i386/prt0.as svneol=native#text/plain
 rtl/freebsd/i386/sighnd.inc svneol=native#text/plain
 rtl/freebsd/i386/sighnd.inc svneol=native#text/plain
 rtl/freebsd/i386/x86.inc svneol=native#text/plain
 rtl/freebsd/i386/x86.inc svneol=native#text/plain

+ 13 - 1
rtl/freebsd/i386/cprt0.as

@@ -15,10 +15,22 @@
 #**********************************************************************}
 #**********************************************************************}
 #
 #
 # FreeBSD  ELF startup code for Free Pascal for dynamical linking to libc.
 # 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:
+#
+# `file gcc` gives
+#
+# 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
 #
 #
 
 
         .file   "cprt0.as"
         .file   "cprt0.as"
-        .ident  "FreePascal 2.0.x series with FreeBSD 5/6 patch"
+        .ident  "FreePascal 2.2.x series dynlinked to libc"
 .section        .note.ABI-tag,"a",@progbits
 .section        .note.ABI-tag,"a",@progbits
         .p2align 2
         .p2align 2
         .type   abitag, @object
         .type   abitag, @object

+ 7 - 0
rtl/freebsd/i386/identpatch.sh

@@ -0,0 +1,7 @@
+#!/bin/sh
+elfdump -n `which elfdump` |awk '/FreeBSD/{print $2}' >elfversion
+IDVERSION=`cat elfversion`
+rm elfversion
+echo Patching cprt0.as with version $IDVERSION
+
+sed -I.sav -es/504000/$IDVERSION/ cprt0.as