Revision 766a487a

b/Makefile
1
ARCH=i386
2
#ARCH=ppc
3

  
4
ifeq ($(ARCH),i386)
1 5
CFLAGS=-Wall -O2 -g
2 6
LDFLAGS=-g
3
DEFINES=-D_GNU_SOURCE -DGEMU -DDOSEMU #-DNO_TRACE_MSGS
7
LIBS=
8
CC=gcc
9
DEFINES=-DHAVE_BYTESWAP_H
10
endif
11

  
12
ifeq ($(ARCH),ppc)
13
GCC_LIBS_DIR=/usr/netgem/tools/lib/gcc-lib/powerpc-linux/2.95.2
14
DIST=/home/fbe/nsv/dist/hw/n6-dtt
15
CC=powerpc-linux-gcc -msoft-float 
16
CFLAGS=-Wall -pipe -O2 -mcpu=405 -mbig -nostdinc -g -I$(GCC_LIBS_DIR)/include -I$(DIST)/include
17
LIBS_DIR=$(DIST)/lib
18
CRT1=$(LIBS_DIR)/crt1.o
19
CRTI=$(LIBS_DIR)/crti.o
20
CRTN=$(LIBS_DIR)/crtn.o
21
CRTBEGIN=$(GCC_LIBS_DIR)/crtbegin.o
22
CRTEND=$(GCC_LIBS_DIR)/crtend.o
23
LDFLAGS=-static -g -nostdlib $(CRT1) $(CRTI) $(CRTBEGIN) 
24
LIBS=-L$(LIBS_DIR) -ltinyc -lgcc $(CRTEND) $(CRTN)
25
DEFINES=-Dsocklen_t=int
26
endif
27

  
28
#########################################################
29

  
30
DEFINES+=-D_GNU_SOURCE -DGEMU -DDOSEMU #-DNO_TRACE_MSGS
31
LDSCRIPT=$(ARCH).ld
4 32

  
5 33
OBJS= i386/fp87.o i386/interp_main.o i386/interp_modrm.o i386/interp_16_32.o \
6 34
      i386/interp_32_16.o i386/interp_32_32.o i386/emu-utils.o \
......
12 40
all: gemu
13 41

  
14 42
gemu: $(OBJS)
15
	$(CC) -Wl,-T,i386.ld $(LDFLAGS) -o $@ $(OBJS)
43
	$(CC) -Wl,-T,$(LDSCRIPT) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
16 44

  
17 45
depend: $(SRCS)
18 46
	$(CC) -MM $(CFLAGS) $^ 1>.depend
b/ppc.ld
1
/* ld script to make i386 Linux kernel
2
 * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>;
3
 */
4
OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
5
OUTPUT_ARCH(powerpc)
6
SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/alpha-unknown-linux-gnu/lib);
7
ENTRY(_start)
8
SECTIONS
9
{
10
  /* Read-only sections, merged into text segment: */
11
  . = 0x60000000 + SIZEOF_HEADERS;
12
  .interp     : { *(.interp) 	}
13
  .hash          : { *(.hash)		}
14
  .dynsym        : { *(.dynsym)		}
15
  .dynstr        : { *(.dynstr)		}
16
  .gnu.version   : { *(.gnu.version)	}
17
  .gnu.version_d   : { *(.gnu.version_d)	}
18
  .gnu.version_r   : { *(.gnu.version_r)	}
19
  .rel.text      :
20
    { *(.rel.text) *(.rel.gnu.linkonce.t*) }
21
  .rela.text     :
22
    { *(.rela.text) *(.rela.gnu.linkonce.t*) }
23
  .rel.data      :
24
    { *(.rel.data) *(.rel.gnu.linkonce.d*) }
25
  .rela.data     :
26
    { *(.rela.data) *(.rela.gnu.linkonce.d*) }
27
  .rel.rodata    :
28
    { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
29
  .rela.rodata   :
30
    { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
31
  .rel.got       : { *(.rel.got)		}
32
  .rela.got      : { *(.rela.got)		}
33
  .rel.ctors     : { *(.rel.ctors)	}
34
  .rela.ctors    : { *(.rela.ctors)	}
35
  .rel.dtors     : { *(.rel.dtors)	}
36
  .rela.dtors    : { *(.rela.dtors)	}
37
  .rel.init      : { *(.rel.init)	}
38
  .rela.init     : { *(.rela.init)	}
39
  .rel.fini      : { *(.rel.fini)	}
40
  .rela.fini     : { *(.rela.fini)	}
41
  .rel.bss       : { *(.rel.bss)		}
42
  .rela.bss      : { *(.rela.bss)		}
43
  .rel.plt       : { *(.rel.plt)		}
44
  .rela.plt      : { *(.rela.plt)		}
45
  .init          : { *(.init)	} =0x47ff041f
46
  .text      :
47
  {
48
    *(.text)
49
    /* .gnu.warning sections are handled specially by elf32.em.  */
50
    *(.gnu.warning)
51
    *(.gnu.linkonce.t*)
52
  } =0x47ff041f
53
  _etext = .;
54
  PROVIDE (etext = .);
55
  .fini      : { *(.fini)    } =0x47ff041f
56
  .rodata    : { *(.rodata) *(.gnu.linkonce.r*) }
57
  .rodata1   : { *(.rodata1) }
58
  .reginfo : { *(.reginfo) }
59
  /* Adjust the address for the data segment.  We want to adjust up to
60
     the same address within the page on the next page up.  */
61
  . = ALIGN(0x100000) + (. & (0x100000 - 1));
62
  .data    :
63
  {
64
    *(.data)
65
    *(.gnu.linkonce.d*)
66
    CONSTRUCTORS
67
  }
68
  .data1   : { *(.data1) }
69
  .ctors         :
70
  {
71
    *(.ctors)
72
  }
73
  .dtors         :
74
  {
75
    *(.dtors)
76
  }
77
  .plt      : { *(.plt)	}
78
  .got           : { *(.got.plt) *(.got) }
79
  .dynamic       : { *(.dynamic) }
80
  /* We want the small data sections together, so single-instruction offsets
81
     can access them all, and initialized data all before uninitialized, so
82
     we can shorten the on-disk segment size.  */
83
  .sdata     : { *(.sdata) }
84
  _edata  =  .;
85
  PROVIDE (edata = .);
86
  __bss_start = .;
87
  .sbss      : { *(.sbss) *(.scommon) }
88
  .bss       :
89
  {
90
   *(.dynbss)
91
   *(.bss)
92
   *(COMMON)
93
  }
94
  _end = . ;
95
  PROVIDE (end = .);
96
  /* Stabs debugging sections.  */
97
  .stab 0 : { *(.stab) }
98
  .stabstr 0 : { *(.stabstr) }
99
  .stab.excl 0 : { *(.stab.excl) }
100
  .stab.exclstr 0 : { *(.stab.exclstr) }
101
  .stab.index 0 : { *(.stab.index) }
102
  .stab.indexstr 0 : { *(.stab.indexstr) }
103
  .comment 0 : { *(.comment) }
104
  /* DWARF debug sections.
105
     Symbols in the DWARF debugging sections are relative to the beginning
106
     of the section so we begin them at 0.  */
107
  /* DWARF 1 */
108
  .debug          0 : { *(.debug) }
109
  .line           0 : { *(.line) }
110
  /* GNU DWARF 1 extensions */
111
  .debug_srcinfo  0 : { *(.debug_srcinfo) }
112
  .debug_sfnames  0 : { *(.debug_sfnames) }
113
  /* DWARF 1.1 and DWARF 2 */
114
  .debug_aranges  0 : { *(.debug_aranges) }
115
  .debug_pubnames 0 : { *(.debug_pubnames) }
116
  /* DWARF 2 */
117
  .debug_info     0 : { *(.debug_info) }
118
  .debug_abbrev   0 : { *(.debug_abbrev) }
119
  .debug_line     0 : { *(.debug_line) }
120
  .debug_frame    0 : { *(.debug_frame) }
121
  .debug_str      0 : { *(.debug_str) }
122
  .debug_loc      0 : { *(.debug_loc) }
123
  .debug_macinfo  0 : { *(.debug_macinfo) }
124
  /* SGI/MIPS DWARF 2 extensions */
125
  .debug_weaknames 0 : { *(.debug_weaknames) }
126
  .debug_funcnames 0 : { *(.debug_funcnames) }
127
  .debug_typenames 0 : { *(.debug_typenames) }
128
  .debug_varnames  0 : { *(.debug_varnames) }
129
  /* These must appear regardless of  .  */
130
}

Also available in: Unified diff