VirtualBox

source: vbox/trunk/src/recompiler/InnoTek/op-darwin.sed@ 4541

Last change on this file since 4541 was 4541, checked in by vboxsync, 17 years ago

sed script must be LF and not native.

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1# $Id: op-darwin.sed 4541 2007-09-05 19:32:48Z vboxsync $
2## @file
3#
4# SED script for transforming op.S (i386 ELF from GNU/linux) into
5# something that the Darwin (Mac OS X) assembler can make use of.
6#
7
8#
9# Copyright (C) 2006-2007 innotek GmbH
10#
11# This file is part of VirtualBox Open Source Edition (OSE), as
12# available from http://www.virtualbox.org. This file is free software;
13# you can redistribute it and/or modify it under the terms of the GNU
14# General Public License as published by the Free Software Foundation,
15# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
16# distribution. VirtualBox OSE is distributed in the hope that it will
17# be useful, but WITHOUT ANY WARRANTY of any kind.
18
19# This is a generic transformation, only encountered with i386-elf-gcc-3.4.3 so far.
20s/^\([[:blank:]]*\)\//\1#/
21
22# Darwin doesn't grok .type and .size, remove those lines.
23/^[[:blank:]]*\.type[[:blank:]]/d
24/^[[:blank:]]*\.size[[:blank:]]/d
25
26# Darwin names the .rodata section '.const'.
27s/^[[:blank:]]*\.section[[:blank:]][[:blank:]]*\.rodata[[:blank:]]*$/\t.const/
28
29# Darwin doesn't grok the the .note.GNU-stack section, remove that line.
30/^[[:blank:]]*\.section[[:blank:]][[:blank:]]*\.note\.GNU-stack,/d
31
32# .zero seems to be similar to .spaces...
33s/^\([[:blank:]]*\)\.zero[[:blank:]][[:blank:]]*\([0-9][0-9]*\)/\1.space \2/
34
35# It looks like if .align is taking a byte count on linux and a power of
36# two on Darwin, translate to power of two.
37s/\.align 128/\.align 7/
38s/\.align 64/\.align 6/
39s/\.align 32/\.align 5/
40s/\.align 16/\.align 4/
41s/\.align 8/\.align 3/
42s/\.align 4/\.align 2/
43s/\.align 2/\.align 1/
44
45
46# Darwin uses underscore prefixed names like the DOS based i386 OSes
47# linux does. So, all global symbols needs to be translated.
48s/^[[:blank:]]*\.globl[[:blank:]][[:blank:]]*\([^\t\n ]*\)[[:blank:]]*$/#define \1 _\1\n.globl \1/
49
50# special hack for __op_labelN
51s/__op_label\([0-9]\)/___op_label\1/g
52
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette