gcc -frandom-seed
-frandom-seed=string
This option provides a seed that GCC uses when it would otherwise
use random numbers. It is used to generate certain symbol names
that have to be different in every compiled file. It is also used
to place unique stamps in coverage data files and the object files
that produce them. You can use the -frandom-seed option to produce
reproducibly identical object files. The string should be different for every file you compile.
http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Debugging-Options.html#Debugging-Options
相同源码、相同编译器的两次编译结果并不是binary identical的,这是因为编译器的部分功能依赖于随机输入(比如生成一些唯一的symbol,一个例子是C++中anonymous namespace在编译的时候要生成一个随机的symbol)
I have been looking at how to make binary reproducible builds in our
project using gcc. It turns out that gcc gives functions in anonymous
namespaces symbol names that are part randomized. If I compile our
project with -frandom-seed=<some value> the random part of the symbol
name will be the same each compile. The man page of gcc tells me that I
need to use a different value for -frandom-seed for each file I compile.
当然还有一个原因可能是源码本身有hack,比如__DATE__...
gcc -frandom-seed的更多相关文章
- SEED信息安全实验系列:缓冲区溢出漏洞实验
缓冲区溢出漏洞实验 本课程详细出自http://www.shiyanlou.com/courses/231,转载请注明出处. 一.实验描述 缓冲区溢出是指程序试图向缓冲区写入超出预分配固定长度数据的情 ...
- 如何使用gcc编译器
开始... 首先,我们应该知道如何调用编译器.实际上,这很简单.我们将从那个著名的第一个C程序开始. #include <stdio.h> int main() { printf(&quo ...
- SEED实验——Environment Variable and Set-UID Program实验报告
任务一:操作环境变量 实验过程一: 用printenv或env打印出环境变量. 在终端输入命令,显示结果如下图所示: 经过实验发现,printenv和env均可输出当前系统的环境变量.不同的是prin ...
- SEED实验——Environment Variable and Set-UID Program实验描述与实验任务
第一部分:实验描述 该实验的学习任务是理解环境变量是如何影响程序和系统行为的.环境变量是一组动态命名的变量 第二部分:实验任务 2.1 任务一:操作环境变量 在这个任务中,我们研究可以用来设置和取消设 ...
- 2017-2018-2 20179215《网络攻防实践》seed缓冲区溢出实验
seed缓冲区溢出实验 有漏洞的程序: /* stack.c */ /* This program has a buffer overflow vulnerability. */ /* Our tas ...
- SEED缓冲区溢出实验笔记
缓冲区溢出实验(Linux 32位) 参考教程与材料:http://www.cis.syr.edu/~wedu/seed/Labs_12.04/Software/Buffer_Overflow/ (本 ...
- VSCode调试go语言出现:exec: "gcc": executable file not found in %PATH%
1.问题描述 由于安装VS15 Preview 5,搞的系统由重新安装一次:在用vscdoe编译go语言时,出现以下问题: # odbcexec: "gcc": executabl ...
- SEED实验系列文章目录
美国雪城大学SEEDLabs实验列表 SEEDLabs是一套完整的信息安全实验,涵盖本科信息安全教学中的大部分基本原理.项目组2002年由杜文亮教授创建,目前开发了30个实验,几百所大学已采用.实验楼 ...
- GCC学习(1)之MinGW使用
GCC学习(1)之MinGW使用 因为后续打算分享一些有关GCC的使用心得的文章,就把此篇当作一个小预热,依此来了解下使用GNU工具链(gcc.gdb.make等)在脱离IDE的情况下如何开发以及涉及 ...
随机推荐
- Android-Android进程间通讯之messenger
转自‘https://www.cnblogs.com/makaruila/p/4869912.html 平时一说进程间通讯,大家都会想到AIDL,其实messenger和AIDL作用一样,都可以进行进 ...
- IntelliJ IDEA打可执行jar包
<plugins> <plugin> <artifactId>maven-assembly-plugin</artifactId> <config ...
- EasyPlayerPro windows播放器本地配置文件配置方法介绍
需求背景 应EasyPlayerPro某客户需求,在EasyPlayerPro启动时,自动播放指定的url源, 不需要每次都去手动填写, 且实现自动播放,不需要手动的单击播放按钮: 为响应该需求,特增 ...
- 使用ab 进行并发压力测试
使用ab 进行并发压力测试 - 参与商 - 博客园 https://www.cnblogs.com/shenshangzz/p/8340640.html 使用ab 进行并发压力测试 ab全称为:a ...
- Linux就该这么学--命令集合9(环境变量)
1.alias命令用于设置命令的别名:(alias 别名=命令) alias lll ="ll" 2.unalias命令用于取消命令的别名:(unalias 别名) unalias ...
- python 的print 用法
print(x,y) 等价于 import sys sys.stdout.write(str(x) + ' ' +str(y) + '\n') 从语法上讲,调用python3.0 的print 函数有 ...
- API的理解和使用——有序集合
有序集合常用的命令 命令 功能 zadd key score member [score member ... ] 添加元素 zcard key 计算成员个数 zscore key member 计算 ...
- Android Weekly Notes Issue #319
Android Weekly Issue #319 July 22nd, 2018. Android Weekly Issue #319 本期内容包括: MotionLayout加动画; Kotlin ...
- Android环境下通过C框架层控制WIFI【转】
本文转载自:https://blog.csdn.net/edw200/article/details/52192631 本人是从事Linux嵌入式开发的,安卓wifi控制在安卓JAVA层已经做得非常成 ...
- Ubuntu apt-get update 失败【转】
本文转载自:http://www.jianshu.com/p/0de2b5717ce8 1 $ sudo apt-get update 报了一堆错误: Err http://cn.archive.ub ...