public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: Object files know where they're built?!?
@ 2003-03-02 21:41 Bruce Korb
  0 siblings, 0 replies; 5+ messages in thread
From: Bruce Korb @ 2003-03-02 21:41 UTC (permalink / raw)
  To: Nathanael Nerode; +Cc: gcc


Hi Nathanael,

Try messing with libelf.  It makes it pretty trivial to
extract certain sections (e.g. "text" and "data"), and
ignore others (that may have date stamps, source file
names, etc.)

Cheers,
	Bruce

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Object files know where they're built?!?
  2003-03-01 17:52 Nathanael Nerode
  2003-03-01 19:11 ` Richard Earnshaw
@ 2003-03-03 10:31 ` Alexandre Oliva
  1 sibling, 0 replies; 5+ messages in thread
From: Alexandre Oliva @ 2003-03-03 10:31 UTC (permalink / raw)
  To: Nathanael Nerode; +Cc: gcc

On Mar  1, 2003, Nathanael Nerode <neroden@twcny.rr.com> wrote:

> Do the object files (on i686-pc-linux-gnu) somehow encode their build 
> location?

Yes.  This is necessary for the debugger to find source files when
they're referenced using relative pathnames.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Object files know where they're built?!?
@ 2003-03-02  1:58 Nathanael Nerode
  0 siblings, 0 replies; 5+ messages in thread
From: Nathanael Nerode @ 2003-03-02  1:58 UTC (permalink / raw)
  To: gcc

Richard Earnshaw said:
>Not necessarily, but they do include the location of source and include 
>files (so that debuggers can find things) -- and most files will 
>include 
>config.h, insn-flags.h, etc which are put in the build directory.
>
>R.

Right.  Stripping debugging information allows me to get a clean 
compare (for purposes of checking that my relocation doesn't change 
anything).  Thanks.

--Nathanael

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Object files know where they're built?!?
  2003-03-01 17:52 Nathanael Nerode
@ 2003-03-01 19:11 ` Richard Earnshaw
  2003-03-03 10:31 ` Alexandre Oliva
  1 sibling, 0 replies; 5+ messages in thread
From: Richard Earnshaw @ 2003-03-01 19:11 UTC (permalink / raw)
  To: Nathanael Nerode; +Cc: gcc, Richard.Earnshaw

> Joseph Myers said:
> >dependencies, between all stages, to one invocation of make, but this
> >can't work because each stage needs to be built separately, with the 
> >files
> >in the same location (not in the stage subdirectory), for the compare
> >stage to succeed.
> 
> I ran into this when I tried to use a different scheme for building 
> stage1.  I wanted to compare the files produced by my new scheme with 
> the files produced by the original.  My new scheme built stage1 in a 
> different directory (stage1-gcc).  Every object file differed at byte 33 
> or 34.
> 
> I couldn't figure out why.
> 
> Do the object files (on i686-pc-linux-gnu) somehow encode their build 
> location?  This would be stupid, obviously, but if it's true it's true. 
> :-)  Is there a way to compare the object files without regard to 
> spurious differences like this?

Not necessarily, but they do include the location of source and include 
files (so that debuggers can find things) -- and most files will include 
config.h, insn-flags.h, etc which are put in the build directory.

R.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Object files know where they're built?!?
@ 2003-03-01 17:52 Nathanael Nerode
  2003-03-01 19:11 ` Richard Earnshaw
  2003-03-03 10:31 ` Alexandre Oliva
  0 siblings, 2 replies; 5+ messages in thread
From: Nathanael Nerode @ 2003-03-01 17:52 UTC (permalink / raw)
  To: gcc

Joseph Myers said:
>dependencies, between all stages, to one invocation of make, but this
>can't work because each stage needs to be built separately, with the 
>files
>in the same location (not in the stage subdirectory), for the compare
>stage to succeed.

I ran into this when I tried to use a different scheme for building 
stage1.  I wanted to compare the files produced by my new scheme with 
the files produced by the original.  My new scheme built stage1 in a 
different directory (stage1-gcc).  Every object file differed at byte 33 
or 34.

I couldn't figure out why.

Do the object files (on i686-pc-linux-gnu) somehow encode their build 
location?  This would be stupid, obviously, but if it's true it's true. 
:-)  Is there a way to compare the object files without regard to 
spurious differences like this?

--Nathanael

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-03-03 10:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-02 21:41 Object files know where they're built?!? Bruce Korb
  -- strict thread matches above, loose matches on Subject: below --
2003-03-02  1:58 Nathanael Nerode
2003-03-01 17:52 Nathanael Nerode
2003-03-01 19:11 ` Richard Earnshaw
2003-03-03 10:31 ` Alexandre Oliva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).