Fresh IDE . Diff
Not logged in

This repository is a mirror!

The original is located on: https://fresh.flatassembler.net/fossil/repo/fresh
If you want to follow the project, please update your remote-url

Differences From Artifact [3ba7101318]:

To Artifact [4fdf362ff0]:







1
2










3

4
5
6
7
8

9
10
11
12
13
14
15
1
2
3
4
5


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+

+





+







; _______________________________________________________________________________________
;|                                                                                       |
;| ..::FreshLib::..  Free, open source. Licensed under "Fresh artistic license."         |
;|_______________________________________________________________________________________|
;
; macroinstruction for importing functions in Linux

;  Description: Macros for importing functions in Linux
;
;  Target OS: Linux
;
;  Dependencies:
;
;  Notes:
;_________________________________________________________________________________________


include '_elf.inc'


macro interpreter [library]
{
 db library,0
}


; creates symbols list with needed libraries.
macro import_proto library, [name, arg]
{
  common
    local str, cnt, use
    match needed,needed@dynamic \{ define needed@dynamic needed, str:cnt:use:library \}
90
91
92
93
94
95
96

97
98
99
100
101

102
103
104
105
106
107
108
109

110
111
112
113
114
115
116
117
118
119
120
121
122
123
124

125
126
127
128
129
130
131

132
133
134
135
136
137
138
139
140
141
142
143
144

145
146
147
148
149
150
151
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172







+





+








+















+







+













+







  match cnt:name, cntandname \{
    if used name
      local fstr
      Elf32_Sym fstr-strtab,0,0,STB_GLOBAL,STT_FUNC,0,0
      cnt = cnt + 1
    end if
  \}


common
  rel:
  local counter
  counter = 1


forward
  match cnt:name, cntandname \{
    if used name
      Elf32_Rel name, counter, R_386_32
      counter = counter + 1
    end if
  \}


common
  relsz = $-rel
  hash:
  dd 1, counter
  dd 0

  repeat counter
   if %=counter
    dd 0
   else
    dd %
   end if
  end repeat
  strtab db 0


forward
  match cnt:name, cntandname \{
    if used name
      fstr def_name name
    end if
  \}


common
  match needed, needed@dynamic \{
    irp item, needed \\{
      match str:cnt:use:library,item \\\{
        use = cnt
        if use > 0
          str db library, 0
        end if
      \\\}
    \\}
  \}
  strsz = $-strtab


forward
  match cnt:name, cntandname \{
    if used name
      name dd 0
    end if