From aff05906d21b6db722b9535e54be1d61b96da0ae Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 19 Aug 1999 13:11:30 +0000 Subject: [PATCH] extend comment. --- binutils/ChangeLog | 4 ++++ binutils/dlltool.c | 29 +++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index bfc6620..1103281 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,7 @@ +1999-08-19 Nick Clifton + + * dlltool.c: Added more examples to the comment at the start. + 1999-08-18 Nick Clifton * dlltool.c (make_head): Only emit interworking directive if diff --git a/binutils/dlltool.c b/binutils/dlltool.c index dc91dba..82576ff 100644 --- a/binutils/dlltool.c +++ b/binutils/dlltool.c @@ -158,14 +158,39 @@ # file (thedll.o) and an imports file (thedll.a). # (You may have to use -S to tell dlltool where to find the assembler). - ./dlltool --def thedll.def --output-exp thedll.o --output-lib thedll.a + dlltool --def thedll.def --output-exp thedll.o --output-lib thedll.a - # Build the dll with the library with file1.o, file2.o and the export table + # Build the dll with the library and the export table + ld -o thedll.dll thedll.o thedll.in # Link the executable with the import library + gcc -o themain.exe themain.o thedll.a + This example can be extended if relocations are needed in the DLL: + + # Compile up the parts of the dll and the program + + gcc -c file1.c file2.c themain.c + + # Run this tool over the DLL's .def file and generate an imports file. + + dlltool --def thedll.def --output-lib thedll.lib + + # Link the executable with the import library and generate a base file + # at the same time + + gcc -o themain.exe themain.o thedll.lib -Wl,--base-file -Wl,themain.base + + # Run this tool over the DLL's .def file and generate an exports file + # which includes the relocations from the base file. + + dlltool --def thedll.def --base-file themain.base --output-exp thedll.exp + + # Build the dll with file1.o, file2.o and the export table + + ld -o thedll.dll thedll.exp file1.o file2.o */ /* .idata section description -- 2.7.4