object headers

object headers

Post by Casey W. Lisc » Thu, 15 Feb 2001 07:41:19



Hi all,

I need to get two executables - compiled at different times, but from
the same source file - to compare as identical.

Stripping the files with AIX's native command leaves a timestamp
header (or a timestamp in the header), so that doesn't work.  I tried
stripping the files, then doing 'strip -H' to remove headers, but then
the file is no longer executable.

I'm using GNU's cmp, which allows one to skip the first n chars when
comparing.  I'm wondering if AIX's timestamp is a known size, thereby
allowing me to 'cmp --ignore-initial <known_size> f1 f2'.

Any other suggestions are _much_ appreciated - I'm pulling hair!

I'm using the following software:

$ uname -a
AIX aixdevel 2 4 00091022C400
$ gcc --version
2.95.2
$ /bin/strip -V
strip: strip.c 1.37
$ cmp --version
cmp - GNU diffutils version 2.7

ps - I've tried using GNU's strip, but...
Versions 2.10 and 2.10.1 (the latest) have a bug that prevents it from
even stripping the files.
Versions 2.9 and 2.9.1 strip the files, but then the files don't run.
I get the error:
exec(): 0509-036 Cannot load program bin.aix42/pull_ut because of the following errors:
        0509-029 Alignment of text does not match required alignment.
        0509-025 The bin.aix42/pull_ut file is not executable or not in correct XCOFF format.
        0509-026 System error: Cannot run a file that does not have a valid format.

--
Casey Liscum
Institute for Scientific Information
(215)386-0100 x-1267

 
 
 

object headers

Post by Casey W. Lisc » Fri, 16 Feb 2001 04:15:25


FYI

I found out that a 'strip -H' (which removes all headers, and renders
an executable... well, unexecutable) consistently removes the first
292 bytes of a previously stripped file (with my software versions,
anyway).  This confirms what I suspected - the timestamp (or, the
header within which it lies) is a known size.  

So, now I do a
strip f1 f2

Then (using GNU's cmp) do a
cmp -i 292 f1 f2

And voila!  They compare as identical no matter when they were
compiled.  

--
Casey Liscum
Institute for Scientific Information
(215)386-0100 x-1267

 
 
 

1. Headers, Headers, whos got the Headers

:   - Does anybody have any idea how the headers are supposed to be arranged
:     and what their contents should be?
:
:   - Which ones go where, which versions should be used, which ones shouldn't
:     be used, where can they be found?
:
:   - Should the headers included with the GNU 2.2.2 release in
:     0.96cpl2inc.tar.Z be used as well as those included with the 0.97
:     kernel? (I wasn't using them)
:
: Any help that anybody could give would be appreciated.  And "No!" I don't plan
: on quitting my day job. :)

I think H.J. and Linus finally have the header problem solved.  Get
2.2.2d when it's released tomorrow and install it with the 0.97pl1
kernel source.  After that, everything should work fine (at least it
does on my system).

David
--
David Engel                        Optical Data Systems, Inc.

(214) 234-6400                     Richardson, TX  75081

2. *** IP FORWARDING QUESTION...

3. header files needed if object files are available in C++ ?

4. Is the HP T3000 Tape drive supported under Linux?

5. Free: Make 3D scan from real object to virtual object

6. newb: why no sound on my redhat 8.0?

7. File locking with Linux NFS server

8. creating new shared object from existing shared objects ??

9. Free: Make 3D scan from real object to virtual object

10. Problem: shared object loading runs constructor of a static object, but static linkage does not.

11. Free: Make 3D scan from real object to virtual object