LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-17-2017, 03:27 PM   #1
LML
LQ Newbie
 
Registered: Jul 2017
Posts: 1

Rep: Reputation: Disabled
Zimage differences when a file is recompiled and source code unchanged


Hello,
A step in our software quality process is to verify our deliverable files. We have made changes to the Linux kernel and build it as a zimage file.
If none of our code is recompiled the zimage is always the same. If we delete one of the .o (elf object files as a test) and force it to be recompiled the resulting zimage file is different. Can anyone explain why? The generated .o files are identical.
 
Old 07-17-2017, 05:13 PM   #2
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010
Hi LML,

Welcome to LQ!

That's the cost of sophisticated, optimizing compilers. The tiniest, most insignificant change will produce a different result. To you the question is logical. The compiler doesn't care. You would probably get a different result from every different compiler too. In a perfect world these things never happen, There is no easy answer.

Last edited by AwesomeMachine; 07-17-2017 at 05:15 PM.
 
Old 07-18-2017, 08:15 AM   #3
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,354
Blog Entries: 13

Rep: Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411
Typically part of the build of a Linux kernel will be the time and date when it was built.

This is one difference between your binary files.
 
Old 07-18-2017, 08:19 AM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,354
Blog Entries: 13

Rep: Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411
Quote:
Originally Posted by AwesomeMachine View Post
Hi LML,

Welcome to LQ!

That's the cost of sophisticated, optimizing compilers. The tiniest, most insignificant change will produce a different result. To you the question is logical. The compiler doesn't care. You would probably get a different result from every different compiler too. In a perfect world these things never happen, There is no easy answer.
Respectfully, without changing build options or any files, this does not seem a reasonable answer. I would never accept a compiler which randomly gave me different results with no explanation. I do realize you are saying tiny changes, however I feel that the OP has explained that they are not changing the source code. Yes I feel different compilers would yield different results, but do not feel they were saying this either.
 
Old 07-19-2017, 03:54 AM   #5
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010Reputation: 1010
Ideally, if the code and compiler remain unchanged, the output remains the same. I have been greatly surprised, however.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] gunzip: [file] has more than one entry -- unchanged checkmate3001 Linux - Software 6 12-13-2013 04:45 AM
Configure.h file is unchanged while building an application. pbardale7 Programming 1 02-16-2012 12:57 PM
[SOLVED] make use of gcc source code to parse c++ source file famsinyi Programming 14 10-19-2009 06:47 PM
get Kernel source form its zImage ra2008 Linux - Newbie 2 07-24-2008 08:28 AM
how to convert zImage to zImage.srec abirami Linux - Software 0 03-06-2005 11:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration