惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
V
Visual Studio Blog
宝玉的分享
宝玉的分享
IT之家
IT之家
人人都是产品经理
人人都是产品经理
T
The Blog of Author Tim Ferriss
I
InfoQ
B
Blog RSS Feed
T
Threatpost
博客园_首页
M
MIT News - Artificial intelligence
Spread Privacy
Spread Privacy
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Know Your Adversary
Know Your Adversary
U
Unit 42
Engineering at Meta
Engineering at Meta
C
Cyber Attacks, Cyber Crime and Cyber Security
月光博客
月光博客
Scott Helme
Scott Helme
T
Tor Project blog
有赞技术团队
有赞技术团队
AWS News Blog
AWS News Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Last Week in AI
Last Week in AI
S
Schneier on Security
Vercel News
Vercel News
博客园 - Franky
C
Cybersecurity and Infrastructure Security Agency CISA
L
LINUX DO - 热门话题
NISL@THU
NISL@THU
L
LangChain Blog
爱范儿
爱范儿
Google DeepMind News
Google DeepMind News
The GitHub Blog
The GitHub Blog
雷峰网
雷峰网
Latest news
Latest news
C
CXSECURITY Database RSS Feed - CXSecurity.com
Hugging Face - Blog
Hugging Face - Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
G
GRAHAM CLULEY
S
Security Affairs
A
About on SuperTechFans
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
大猫的无限游戏
大猫的无限游戏
W
WeLiveSecurity
Cisco Talos Blog
Cisco Talos Blog
罗磊的独立博客

博客园 - floerggyy

vs下调试多个c项目联调 C语言locale介绍 C语言宏定义总结 原码、反码、补码 Endian的由来及big-edian 和little-endian 转载 zip文件格式 C 语言 相关资源 精选 zlib usage 一段垃圾的代码(附malloc,calloc和realloc使用小结) Stdcall and DLL tools of MSVC and MinGW 技术转载(鼠标点击X窗口关闭IE的同时清空session,最基本的就是处理用户重复登陆需要用到,我想这个的关键在于如何捕捉到关闭IE这个动作,之后再根据自身的需要使用session.invalidate()或者session.removeAttribute( "xxx ")) dotnet oracle摘自msdn 被遗忘了的生日 这处站点真NB!! 数学表达式逻辑表达式混合计算 Are you a vender or manager? did you fix these bugs hotmail 附件上传何以如此霸道
转载 关于gcc的dlltool和dllwrap工具
floerggyy · 2008-02-13 · via 博客园 - floerggyy

转自:http://hi.baidu.com/oofy/blog/item/fa788a23ebdb4947ad34dede.html
一直没搞明白过这两个东西,今天花工夫用了一下.

总结如下:

mingw中创建dll有两种方式,一是使用    gcc -shared ...
二是使用dllwrap ...

dllwrap是一组工具的调用.gcc -shared是直接生成.

dllwrap相对更灵活一些.不过gcc -shared基本上也够用.

dlltool是用于生成def,exp,lib文件的工具.
它可以基于obj文件(基中函数标记为__declspec(dllexport))或def文件生成exp和lib文件.
前者(exp文件,其中包含了.edata段)是用于创建dll,后者(lib文件,包含.idata段)用于使用dll

dlltool中DLLNAME参数其实只用于产生def文件中library语名和lib中的dll名.
它本身并不需要dll的信息.

几个主要的参考文档:
使用gcc -shared创建dll,也是一个实验的好基础:
http://www.adp-gmbh.ch/win/misc/mingw/dll.html

gnu-binutils manual, as/ar/ranlib/dlltool/ld都是它的一部分
gcc -shared相关的几个参数:

--add-stdcall-alias                  Export symbols with and without @nn
--kill-at    Remove @nn from exported symbols
--out-implib <file>        Generate import library
--output-def <file>               Generate a .DEF file for the built DLL

dlltool的参数
-z --output-def <deffile> Name of .def file to be created.
--export-all-symbols Export all symbols to .def
--no-export-all-symbols Only export listed symbols
--exclude-symbols <list> Don't export <list>
--no-default-excludes Clear default exclude symbols
-b --base-file <basefile> Read linker generated base file.
-x --no-idata4 Don't generate idata$4 section.
-c --no-idata5 Don't generate idata$5 section.
-U --add-underscore Add underscores to symbols in interface library.
-k --kill-at Kill @<n> from exported names.
-A --add-stdcall-alias Add aliases without @<n>.
-p --ext-prefix-alias <prefix> Add aliases with <prefix>.

关于msvc和gcc中生成__stdcall调用的dll
http://www.geocities.com/yongweiwu/stdcall.htm

还有,就是亲手实验.