Last change
on this file since 1243 was 1241, checked in by bird, 22 years ago |
early coding.
|
-
Property cvs2svn:cvs-rev
set to
1.1
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
2.6 KB
|
Line | |
---|
1 | .file "weak4-2.s"
|
---|
2 |
|
---|
3 |
|
---|
4 | .text
|
---|
5 |
|
---|
6 | .align 4,0xcc
|
---|
7 | nop
|
---|
8 | int $41
|
---|
9 | nop
|
---|
10 | .align 3,0xcc
|
---|
11 | .globl _check_weaktext
|
---|
12 | /*
|
---|
13 | * Check up weak text.
|
---|
14 | */
|
---|
15 | _check_weaktext:
|
---|
16 | xorl %eax, %eax
|
---|
17 | inc %eax /* eax = non-zero */
|
---|
18 | call _weaktext+6
|
---|
19 | orl %eax, %eax
|
---|
20 | jnz failure
|
---|
21 |
|
---|
22 | inc %eax /* eax = non-zero */
|
---|
23 | leal _weaktext+6, %ecx
|
---|
24 | call *%ecx
|
---|
25 | orl %eax, %eax
|
---|
26 | jnz failure
|
---|
27 | jmp done
|
---|
28 |
|
---|
29 |
|
---|
30 | .align 3,0xcc
|
---|
31 | .globl _check_weakdata
|
---|
32 | /*
|
---|
33 | * Check up weak data.
|
---|
34 | */
|
---|
35 | _check_weakdata:
|
---|
36 | movl _weakdata+12, %eax
|
---|
37 | cmpl $3, %eax
|
---|
38 | jnz failure
|
---|
39 |
|
---|
40 | lea _weakdata+20, %eax
|
---|
41 | movl (%eax), %eax
|
---|
42 | cmpl $5, %eax
|
---|
43 | jnz failure
|
---|
44 | jmp done
|
---|
45 |
|
---|
46 | .align 3,0xcc
|
---|
47 | .globl _check_weakbss
|
---|
48 | /*
|
---|
49 | * Check up weak bss.
|
---|
50 | */
|
---|
51 | _check_weakbss:
|
---|
52 | movl _weakbss+12, %eax
|
---|
53 | cmpl $3, %eax
|
---|
54 | jnz failure
|
---|
55 |
|
---|
56 | lea _weakbss+20, %eax
|
---|
57 | movl (%eax), %eax
|
---|
58 | cmpl $5, %eax
|
---|
59 | jnz failure
|
---|
60 | jmp done
|
---|
61 |
|
---|
62 | .align 3,0xcc
|
---|
63 | .globl _check_weakundef
|
---|
64 | /*
|
---|
65 | * Check up weak undef (in main).
|
---|
66 | */
|
---|
67 | _check_weakundef:
|
---|
68 | .weak _weakundef
|
---|
69 | movl _weakundef+12, %eax
|
---|
70 | cmpl $3, %eax
|
---|
71 | jnz failure
|
---|
72 |
|
---|
73 | lea _weakundef+20, %eax
|
---|
74 | movl (%eax), %eax
|
---|
75 | cmpl $5, %eax
|
---|
76 | jnz failure
|
---|
77 | jmp done
|
---|
78 |
|
---|
79 | .align 3,0xcc
|
---|
80 | .globl _check_weakabs
|
---|
81 | /*
|
---|
82 | * Check up weak abs (=0xdead)
|
---|
83 | */
|
---|
84 | _check_weakabs:
|
---|
85 | leal _weakabs, %eax
|
---|
86 | cmpl $0xdead, %eax
|
---|
87 | jnz failure
|
---|
88 |
|
---|
89 | leal _weakabs+2, %eax
|
---|
90 | cmpl $0xdeaf, %eax
|
---|
91 | jnz failure
|
---|
92 | jmp done
|
---|
93 |
|
---|
94 | done:
|
---|
95 | xorl %eax, %eax
|
---|
96 | ret
|
---|
97 | failure:
|
---|
98 | movl $1, %eax
|
---|
99 | ret
|
---|
100 |
|
---|
101 | /*
|
---|
102 | * Weak text.
|
---|
103 | */
|
---|
104 | .align 4,0xcc
|
---|
105 | nop
|
---|
106 | int $42
|
---|
107 | nop
|
---|
108 | .align 3,0xcc
|
---|
109 | .weak _weaktext
|
---|
110 | _weaktext:
|
---|
111 | int $3 /* 0 */
|
---|
112 | int $3 /* 1 */
|
---|
113 | int $3 /* 2 */
|
---|
114 | int $3 /* 3 */
|
---|
115 | int $3 /* 4 */
|
---|
116 | int $3 /* 5 */
|
---|
117 | xorl %eax, %eax /* 6 */
|
---|
118 | ret
|
---|
119 | int $3 /* 7 */
|
---|
120 | int $3 /* 8 */
|
---|
121 | int $3 /* 9 */
|
---|
122 |
|
---|
123 |
|
---|
124 | /*
|
---|
125 | * Weak data.
|
---|
126 | */
|
---|
127 | .data
|
---|
128 | .weak _weakdata
|
---|
129 | _weakdata:
|
---|
130 | .long 0
|
---|
131 | .long 1
|
---|
132 | .long 2
|
---|
133 | .long 3
|
---|
134 | .long 4
|
---|
135 | .long 5
|
---|
136 | .long 6
|
---|
137 | .long 7
|
---|
138 |
|
---|
139 |
|
---|
140 | /*
|
---|
141 | * Weak bss (initiated by main()).
|
---|
142 | */
|
---|
143 | .bss
|
---|
144 | .weak _weakbss
|
---|
145 | _weakbss:
|
---|
146 | .space 40
|
---|
147 |
|
---|
148 |
|
---|
149 | /*
|
---|
150 | * Weak abs
|
---|
151 | */
|
---|
152 | .weak _weakabs
|
---|
153 | .equ _weakabs, 0xdead
|
---|
154 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.