- 浏览: 293695 次
-
文章分类
- 全部博客 (276)
- burp+hydra暴力破解 (1)
- kali linux工具集 (6)
- kali (59)
- linux (54)
- password (14)
- web (63)
- 渗透测试 (50)
- windows (40)
- metasploit (9)
- 信息收集 (32)
- burp suit (4)
- 安全审计 (9)
- https://github.com/secretsquirrel/the-backdoor-factory (0)
- nmap (4)
- arachni (2)
- 工具 (5)
- sql (3)
- 网络 (2)
- 后渗透测试 (10)
- 内网 (5)
- 无线 (2)
- C (3)
- bios (1)
- RoR (12)
- mongodb (1)
- linxu (1)
- gdb (1)
- linux,虚拟化 (1)
- python (4)
最新评论
[url]
https://gcc.gnu.org/ml/gcc-help/2003-08/msg00128.html
https://embeddedfreak.wordpress.com/2009/02/10/removing-unused-functionsdead-codes-with-gccgnu-ld/
[/url]
Hi Dr. Rupp,
I was just looking into this very thing!
Do this in your Makefile...
--------8<--------
DEADCODESTRIP := -Wl,-static -fvtable-gc -fdata-sections -ffunction-sections -Wl,--gc-sections -Wl,-s
foo : foo.c
g++ $(DEADCODESTRIP) $< -o $@
--------8<--------
Step by step...
-Wl,-static
Link against static libraries. Required for dead-code elimination.
-fvtable-gc
C++ virtual method table instrumented with garbage collection information for the linker.
-fdata-sections
Keeps data in separate data sections, so they can be discarded if unused.
-ffunction-sections
Keeps funcitons in separate data sections, so they can be discarded if unused.
-Wl,--gc-sections
Tell the linker to garbage collect and discard unused sections.
-s
Strip the debug information, so as to make the code as small as possible. (I presume that you'd want to do this in a dead-code removal build.)
The requirement to link against the static libraries was surprising to me. But there you go.
HTH,
https://gcc.gnu.org/ml/gcc-help/2003-08/msg00128.html
https://embeddedfreak.wordpress.com/2009/02/10/removing-unused-functionsdead-codes-with-gccgnu-ld/
[/url]
引用
Hi Dr. Rupp,
I was just looking into this very thing!
Do this in your Makefile...
--------8<--------
DEADCODESTRIP := -Wl,-static -fvtable-gc -fdata-sections -ffunction-sections -Wl,--gc-sections -Wl,-s
foo : foo.c
g++ $(DEADCODESTRIP) $< -o $@
--------8<--------
Step by step...
-Wl,-static
Link against static libraries. Required for dead-code elimination.
-fvtable-gc
C++ virtual method table instrumented with garbage collection information for the linker.
-fdata-sections
Keeps data in separate data sections, so they can be discarded if unused.
-ffunction-sections
Keeps funcitons in separate data sections, so they can be discarded if unused.
-Wl,--gc-sections
Tell the linker to garbage collect and discard unused sections.
-s
Strip the debug information, so as to make the code as small as possible. (I presume that you'd want to do this in a dead-code removal build.)
The requirement to link against the static libraries was surprising to me. But there you go.
HTH,
发表评论
-
python 修饰器
2016-02-05 15:11 427def wrapper1(function): ... -
ubuntu 14.04 install e431 wifi driver
2016-01-25 20:59 463引用 sudo apt-get install linu ... -
git
2016-01-07 12:01 461http://finalshares.cn/attachmen ... -
嵌入式中使用gdb
2016-01-06 17:38 3715编译 For gdb: /path/to/gdb-sr ... -
linux change boot image
2016-01-02 00:55 5501. change grub2 引用vim /etc/defa ... -
binwalk --dd
2015-12-28 21:51 1432http://www.devttys0.com/2012/12 ... -
embeded LD_PRELOAD
2015-12-28 00:17 577引用 eve@eve:~/squashfs-root$ sud ... -
hardware hacking
2015-12-27 01:32 707For video stuff: https://www.yo ... -
ubuntu support kindle
2015-12-20 23:13 380引用apt-get install mtpfs -
linux 备份系统
2015-12-05 22:22 428引用备份 dd if=/dev/sda > myimag ... -
[译]root权限运行vlc
2015-11-30 22:19 1421原文地址:http://www.blackmoreops.co ... -
【转】关闭TCP Timestamps来节省一点带宽
2015-10-15 23:29 1660http://highscalability.com/blog ... -
[转]Terminal escape sequences – the new XSS for Linux sysadmins
2015-09-25 23:58 448https://ma.ttias.be/terminal-es ... -
ipython basic
2015-09-25 11:31 482Introspection引用 Using a questio ... -
static in C
2015-09-22 11:35 326jason@ubuntu:~/test$ cat a.c ... -
lxc重命名容器名
2015-09-20 00:25 831lxc-ls 使用文件夹名作为容器名。所以可以更改文件夹名称来 ... -
lxc更新apt源
2015-09-18 11:49 774最近一直在使用lxc创建容器,每次创建一个容器都需要把apt源 ... -
wireshark:Couldn't run /usr/bin/dumpcap in child process: Permission denied
2015-09-11 10:26 3393When start wireshark, I met an ... -
[转]调试python内存泄漏
2015-09-09 00:48 388http://chase-seibert.github.io/ ... -
[转]Python @classmethod and @staticmethod for beginner?
2015-09-07 16:59 383http://stackoverflow.com/questi ...
相关推荐
解决mtk6572平台modem编译错误! Please install the GCC Cross-Compiler on correct path: tools/GCC/4.6.2/linux/bin/arm-none-eabi-gcc
It includes the GNU Compiler (GCC) and is available free of charge directly from Arm for embedded software development on Windows, Linux and Mac OS X operating systems. Follow the links on this page ...
C语言编译器关于gnu/stubs-32.h文件的解决方法 在64位Linux系统下编译C语言程序时,可能会出现gnu/stubs-32.h文件不存在的错误,主要是因为缺少32位兼容包的原因。今天,我们就来探讨解决这个问题的方法。 首先,...
mips-linux-gnu-ingenic-gcc7.2.0-glibc2.29-fp64-r5.1.1.tar.bz2
Configured with: /opt/crosstool/crosstool-0.28/build/arm-linux/gcc-3.4.1-glibc-2.3.2/gcc-3.4.1/configure --target=arm-linux --host=i686-host_pc-linux-gnu --prefix=/opt/crosstool/arm-linux/gcc-3.4.1-...
标题中的“gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu.tar.gz”指的是一款由Linaro组织提供的GCC(GNU Compiler Collection)交叉编译器,版本号为6.3.1,发布于2017年5月。这个版本是针对x86_64架构的主机...
标题中的"aarch64-linux-gnu-gcc"是一个交叉编译器,用于在aarch64(也称为ARM64或AArch64)架构上构建Linux应用程序。它基于GNU工具链,是GCC(GNU Compiler Collection)的一个特定版本,这里是7.5.0,由Linaro...
标题中的“gcc-linaro-6.3.1-2017.05-x86-64-aarch64-linux-gnu.7z”是一个GCC(GNU Compiler Collection)的特定版本,由Linaro组织提供。Linaro是一个开源软件工程组织,专注于优化和维护开源软件在ARM架构上的...
It includes the GNU Compiler (GCC) and is available free of charge directly from Arm for embedded software development on Windows, Linux and Mac OS X operating systems. Follow the links on this page ...
arm-linux-gcc 使用 GNU 的 Glibc,而 arm-elf-gcc 一般使用 uClibc/uC-libc 或者 newlib。 uClibc/uC-libc 和 newlib 都是 C 语言库文件,只是所应用的领域不同而已。uClibc/uC-libc 是与 Glibc API 兼容的小型化 ...
Configured with: /scratch/maciej/arm-linux-2014.05-rel/src/gcc-4.8-2014.05/configure --build=i686-pc-linux-gnu --host=i686-mingw32 --target=arm-none-linux-gnueabi ...... Thread model: posix gcc ...
gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.tar是由 Linaro 公司基于GCC推出的的ARM交叉编译工具。可用于交叉编译64-bit Armv8 Cortex-A, little-endian目标中的裸机程序、u-boot、Linux kernel、...
Configured with: /opt/crosstool/crosstool-0.28/build/arm-linux/gcc-3.4.1-glibc-2.3.2/gcc-3.4.1/configure --target=arm-linux --host=i686-host_pc-linux-gnu --prefix=/opt/crosstool/arm-linux/gcc-3.4.1-...
2. **gcc**: GCC(GNU Compiler Collection)是GNU项目的一部分,提供了C、C++、Objective-C、Fortran等多种编程语言的编译器。在Linux环境中,GCC是开发和编译软件的基础工具,它将源代码转化为可执行程序。 3. **...
gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu.tar.tar是由 Linaro 公司基于GCC推出的的ARM交叉编译工具。可用于交叉编译64-bit Armv8 Cortex-A, little-endian目标中的裸机程序、u-boot、Linux kernel、...
arm-linux-gcc交叉编译工具: 备注:使用此资源时需要解压两次,因为上传时显示资源重复上传失败,于是套了两层压缩。建议使用window系统下载先解压一次再到Linux中进行解压,这样方便查看 此外,如果把编译器gcc...
例如,使用`aarch64-linux-gnu-gcc`替代原本的`gcc`来编译源代码。 在实际开发过程中,交叉编译链可以极大地提高效率,尤其是在嵌入式系统开发中,目标平台的资源有限,直接在其上编译可能会非常耗时。此外,Linaro...
交叉编译工具:gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.bz2 解压命令:tar jxvf gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.bz2
gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu是由 Linaro 公司基于GCC推出的的ARM交叉编译工具。可用于交叉编译64-bit Armv8 Cortex-A, little-endian hard-float, little-endian目标中的裸机程序、u-boot、...