~ubuntu-branches/ubuntu/feisty/fpc/feisty

« back to all changes in this revision

Viewing changes to compiler/powerpc/agppcgas.pas

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2007-01-27 20:08:50 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070127200850-9mrptaqqjsx9nwa7
Tags: 2.0.4-5
* Fixed Build-Depends.
* Add myself to Uploaders in debian/control.
* Make sure that the sources are really patched before building them.
* Build unit 'libc' on powerpc too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
{
2
 
    $Id: agppcgas.pas,v 1.47 2005/02/14 17:13:10 peter Exp $
3
2
    Copyright (c) 1998-2002 by Florian Klaempfl
4
3
 
5
4
    This unit implements an asm for the PowerPC
30
29
  interface
31
30
 
32
31
    uses
 
32
       aasmbase,
33
33
       aasmtai,
34
34
       aggas,
35
35
       cpubase;
37
37
    type
38
38
      PPPCGNUAssembler=^TPPCGNUAssembler;
39
39
      TPPCGNUAssembler=class(TGNUassembler)
 
40
        function sectionname(atype:tasmsectiontype;const aname:string):string;override;
40
41
        procedure WriteExtraHeader;override;
41
42
        procedure WriteInstruction(hp : tai);override;
42
43
      end;
45
46
  implementation
46
47
 
47
48
    uses
48
 
       cutils,globals,verbose,
 
49
       cutils,globals,verbose,globtype,
49
50
       cgbase,cgutils,systems,
50
51
       assemble,
51
52
       itcpugas,
79
80
          );
80
81
 
81
82
 
82
 
       as_ppc_gas_darwin_info : tasminfo =
 
83
       as_ppc_gas_darwin_powerpc_info : tasminfo =
83
84
          (
84
85
            id     : as_darwin;
85
86
 
86
87
            idtxt  : 'AS-Darwin';
87
88
            asmbin : 'as';
88
 
            asmcmd : '-o $OBJ $ASM';
 
89
            asmcmd : '-o $OBJ $ASM -arch ppc';
89
90
            supported_target : system_any;
90
91
            flags : [af_allowdirect,af_needar,af_smartlink_sections];
91
92
            labelprefix : 'L';
97
98
       refaddr2str_darwin: array[trefaddr] of string[4] = ('','','ha16','lo16','');
98
99
 
99
100
 
 
101
 
 
102
    function TPPCGNUAssembler.sectionname(atype:tasmsectiontype;const aname:string):string;
 
103
      begin
 
104
        if (target_info.system = system_powerpc_darwin) and
 
105
           (atype = sec_bss) then
 
106
          atype := sec_code;
 
107
        result := inherited sectionname(atype,aname);
 
108
      end;
 
109
 
 
110
 
100
111
    function getreferencestring(var ref : treference) : string;
101
112
    var
102
113
      s : string;
144
155
             begin
145
156
                if offset=0 then
146
157
                  begin
147
 
                    if assigned(symbol) then
148
 
                      begin
149
 
                        if target_info.system <> system_powerpc_darwin then
150
 
                          s:=s+'+0'
151
 
                      end
152
 
                    else
 
158
                    if not (assigned(symbol)) then
153
159
                      s:=s+'0';
154
160
                  end;
155
161
                s:=s+'('+gas_regname(base)+')';
361
367
 
362
368
begin
363
369
  RegisterAssembler(as_ppc_gas_info,TPPCGNUAssembler);
364
 
  RegisterAssembler(as_ppc_gas_darwin_info,TPPCGNUAssembler);
 
370
  RegisterAssembler(as_ppc_gas_darwin_powerpc_info,TPPCGNUAssembler);
365
371
end.
366
 
{
367
 
  $Log: agppcgas.pas,v $
368
 
  Revision 1.47  2005/02/14 17:13:10  peter
369
 
    * truncate log
370
 
 
371
 
}