Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
daecaba4
Commit
daecaba4
authored
Mar 16, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't enter an imported dll in the import table at all if we didn't
need to import any symbol from it.
parent
f602ec66
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
5 deletions
+22
-5
import.c
tools/winebuild/import.c
+22
-5
No files found.
tools/winebuild/import.c
View file @
daecaba4
...
...
@@ -374,6 +374,17 @@ void add_import_dll( const char *name, int delay )
else
free_imports
(
imp
);
}
/* remove an imported dll, based on its index in the dll_imports array */
static
void
remove_import_dll
(
int
index
)
{
struct
import
*
imp
=
dll_imports
[
index
];
memmove
(
&
dll_imports
[
index
],
&
dll_imports
[
index
+
1
],
sizeof
(
imp
)
*
(
nb_imports
-
index
-
1
)
);
nb_imports
--
;
if
(
imp
->
delay
)
nb_delayed
--
;
free_imports
(
imp
);
}
/* initialize the list of ignored symbols */
static
void
init_ignored_symbols
(
void
)
{
...
...
@@ -545,8 +556,8 @@ static void add_extra_undef_symbols(void)
}
}
/*
warn if a given dll is not used, but check forwards firs
t */
static
void
warn
_unused
(
const
struct
import
*
imp
)
/*
check if a given imported dll is not needed, taking forwards into accoun
t */
static
int
check
_unused
(
const
struct
import
*
imp
)
{
int
i
;
size_t
len
=
strlen
(
imp
->
dll
);
...
...
@@ -559,9 +570,9 @@ static void warn_unused( const struct import* imp )
if
(
!
odp
||
!
(
odp
->
flags
&
FLAG_FORWARD
))
continue
;
if
(
!
strncasecmp
(
odp
->
link_name
,
imp
->
dll
,
len
)
&&
odp
->
link_name
[
len
]
==
'.'
)
return
;
/* found an import, do not warn
*/
return
0
;
/* found a forward, it is used
*/
}
warning
(
"%s imported but no symbols used
\n
"
,
imp
->
dll
)
;
return
1
;
}
/* combine a list of object files with ld into a single object file */
...
...
@@ -667,7 +678,13 @@ int resolve_imports( void )
}
}
/* remove all the holes in the undef symbols list */
if
(
!
remove_symbol_holes
())
warn_unused
(
imp
);
if
(
!
remove_symbol_holes
()
&&
check_unused
(
imp
))
{
/* the dll is not used, get rid of it */
warning
(
"%s imported but no symbols used
\n
"
,
imp
->
dll
);
remove_import_dll
(
i
);
i
--
;
}
}
return
1
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment