Differences From Artifact [3ba7101318]:
- Executable file freshlib/macros/Linux/_import.inc — part of check-in [9f7d99a53b] at 2011-04-05 13:36:12 on branch FreshLibDev — A lot of code revision in order to make it to not be compiled when not in use. This includes the library code and import macros for Linux. Also the work continues that to provide clean startup and termination of complex programs. (user: lhmnai0 size: 2862)
To Artifact [4fdf362ff0]:
- Executable file
freshlib/macros/Linux/_import.inc
— part of check-in
[c95846ab5c]
at
2011-04-06 11:18:30
on branch FreshLibDev
— Added unified title comments block to every file in the source tree. The title comments block contains only
information about file purpose, possible dependencies and target OS.
I intentionally removed from title comments all information about people, changes, reference and dates, because this kind of information is imposible to be maintained up to date. This makes it useless or even misleading.
Information about license and development team is added in readme.txt and license.txt files. (user: lhmnai0 size: 3405) [more...]
|
| > > > > > | | > > > > > > > > > > | 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." |
;|_______________________________________________________________________________________|
;
; 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 |
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
| > > > > > > | 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
|
| ︙ | ︙ |