On Thu, Aug 02, 2007 at 11:34:23PM +0100, Ken Moffat wrote:
> 
>  Anybody who follows my ramblings on clfs-dev will know that using
> an earlier kernel than the headers, particularly an -rc kernel, is
> "NOT a Good Idea" (TM) and I'm lucky I wasn't using glibc-2.6.
> 
>  I'll try to do a fresh by-the-book pair of builds (without
> non-toolchain tests) if I've got time.
> 
 I rather wish I hadn't bothered!  This was 2007-07-31 with
glibc-2.5.1.  The following files differed:

/lib/libc-2.5.1.so
/usr/bin/perl (also flagged as perl5.8.8 which is a hard link)
/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/cc1 - generally expected
/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/cc1plus - generally expected
/usr/lib/libstdc++.la - known difference
/usr/lib/libsupc++.la - known difference
/usr/share/doc/groff/1.18.1.4/meintro.ps impenetrable difference in numbers
/usr/share/doc/groff/1.18.1.4/meref.ps impenetrable difference in numbers
/usr/share/info/coreutils.info - known problem, second build used precompiled 
info

 Of these, the libtool archives add, or rather repeat, directories
in the first inplace build - libtool is like that, not a significant
issue.  cc1 and cc1plus seem to differ for everybody, they should
probably be treated as 'expected to differ'.

 The postscript files are impenetrable, the differences are in long
strings of numbers - this is the first time I've run farce on this
version of groff and I suspect these numbers are calculated, and
there is a small amount of error.  I'm not worried about this.

 That just leaves two somewhat important binaries.  Looking at
'farce-extras' didn't show anything recognisable, so I can't get
away with changing one of the regexes to allow a different
date/time/version string.  Time for strip --strip-all, but that
just seemed to show binary differences and strings moving slightly,
as on my previous build (UTF-8, for those wondering why this version
of groff is new to me, and unreliable because one kernel was
unreliable).  This time, I made sure I was using 2.6.22.1 for both
builds.  On to objdump -d followed by diff -u.  For libc-2.5.1.so
there are various changes in addresses, enough to make me wonder if
address randomization is playing a part here:

-libc-2.5.1.so-0:     file format elf32-i386
+libc-2.5.1.so-1:     file format elf32-i386
 
 Disassembly of section .plt:
 
@@ -310,7 +310,7 @@
    158c6:      8d 76 00                lea    0x0(%esi),%esi
    158c9:      8d bc 27 00 00 00 00    lea    0x0(%edi),%edi
    158d0:      55                      push   %ebp
-   158d1:      b8 e2 02 00 00          mov    $0x2e2,%eax
+   158d1:      b8 de 02 00 00          mov    $0x2de,%eax
    158d6:      89 e5                   mov    %esp,%ebp
    158d8:      53                      push   %ebx
    158d9:      e8 42 fd ff ff          call   15620 <[EMAIL PROTECTED]>
@@ -482,7 +482,7 @@
    15adc:      5d                      pop    %ebp
    15add:      c3                      ret
    15ade:      89 f6                   mov    %esi,%esi
-   15ae0:      8d 83 cc 9a fe ff       lea    0xfffe9acc(%ebx),%eax
+   15ae0:      8d 83 ac 9a fe ff       lea    0xfffe9aac(%ebx),%eax
    15ae6:      89 04 24                mov    %eax,(%esp)
    15ae9:      e8 82 89 04 00          call   5e470 <__libc_fatal>
    15aee:      89 f6                   mov    %esi,%esi
@@ -1157,7 +1157,7 @@ 
    1621f:      89 44 24 08             mov    %eax,0x8(%esp)
    16223:      8d 83 77 5f fe ff       lea    0xfffe5f77(%ebx),%eax
    16229:      89 44 24 04             mov    %eax,0x4(%esp)
-   1622d:      8d 83 08 9b fe ff       lea    0xfffe9b08(%ebx),%eax
+   1622d:      8d 83 e8 9a fe ff       lea    0xfffe9ae8(%ebx),%eax
    16233:      89 04 24                mov    %eax,(%esp)
    16236:      e8 85 bb 00 00          call   21dc0 <__assert_fail>
    1623b:      8b 83 54 ff ff ff       mov    0xffffff54(%ebx),%eax
@@ -1985,7 +1985,7 @@
    16c59:      89 44 24 08             mov    %eax,0x8(%esp)
    16c5d:      8d 83 8c 5f fe ff       lea    0xfffe5f8c(%ebx),%eax
    16c63:      89 44 24 04             mov    %eax,0x4(%esp)
-   16c67:      8d 83 2c 9b fe ff       lea    0xfffe9b2c(%ebx),%eax
+   16c67:      8d 83 0c 9b fe ff       lea    0xfffe9b0c(%ebx),%eax

 (stopped there, possibly there are other types of changes, but I'm
 already out of my depth).

 Perl is much nastier - the file sizes reported by 'ls -l' differ
even after 'strip --strip-all' : I know 'ls -l' is not totally
reliable for this, but the disassembly seems to indicate it has been
built differently:

--- objdump-d-perl-0    2007-08-04 23:23:45.000000000 +0100
+++ objdump-d-perl-1    2007-08-04 23:23:52.000000000 +0100
@@ -1,5 +1,5 @@
 
-perl-0:     file format elf32-i386
+perl-1:     file format elf32-i386
 
 Disassembly of section .init:
 
@@ -7,9 +7,9 @@
  805d804:      55                      push   %ebp
  805d805:      89 e5                   mov    %esp,%ebp
  805d807:      83 ec 08                sub    $0x8,%esp
- 805d80a:      e8 25 0e 00 00          call   805e634 <_start+0x24>
- 805d80f:      e8 7c 0e 00 00          call   805e690 <_start+0x80>
- 805d814:      e8 87 4f 0b 00          call   81127a0 <__libc_csu_init+0x220>
+ 805d80a:      e8 25 0e 00 00          call   805e634 <call_gmon_start>
+ 805d80f:      e8 7c 0e 00 00          call   805e690 <frame_dummy>
+ 805d814:      e8 87 4f 0b 00          call   81127a0 <__do_global_ctors_aux>
  805d819:      c9                      leave
  805d81a:      c3                      ret
 Disassembly of section .plt:
@@ -1148,16 +1148,18 @@
  805e631:      f4                      hlt
  805e632:      90                      nop
  805e633:      90                      nop
+
+0805e634 <call_gmon_start>:
  805e634:      55                      push   %ebp
  805e635:      89 e5                   mov    %esp,%ebp
  805e637:      53                      push   %ebx
  805e638:      83 ec 04                sub    $0x4,%esp
- 805e63b:      e8 00 00 00 00          call   805e640 <_start+0x30>
+ 805e63b:      e8 00 00 00 00          call   805e640 <call_gmon_start+0xc>
  805e640:      5b                      pop    %ebx
  805e641:      81 c3 c8 9a 0c 00       add    $0xc9ac8,%ebx
  805e647:      8b 93 fc ff ff ff       mov    0xfffffffc(%ebx),%edx
  805e64d:      85 d2                   test   %edx,%edx
- 805e64f:      74 05                   je     805e656 <_start+0x46>
+ 805e64f:      74 05                   je     805e656 <call_gmon_start+0x22>
  805e651:      e8 76 ff ff ff          call   805e5cc <[EMAIL PROTECTED]>
  805e656:      58                      pop    %eax
  805e657:      5b                      pop    %ebx
@@ -1169,32 +1171,36 @@
  805e65d:      90                      nop
  805e65e:      90                      nop
  805e65f:      90                      nop
+
+0805e660 <__do_global_dtors_aux>:
  805e660:      55                      push   %ebp
  805e661:      89 e5                   mov    %esp,%ebp
  805e663:      83 ec 08                sub    $0x8,%esp
  805e666:      80 3d 50 ae 12 08 00    cmpb   $0x0,0x812ae50
- 805e66d:      74 0c                   je     805e67b <_start+0x6b>
- 805e66f:      eb 1c                   jmp    805e68d <_start+0x7d>
+ 805e66d:      74 0c                   je     805e67b 
<__do_global_dtors_aux+0x1b>
+ 805e66f:      eb 1c                   jmp    805e68d 
<__do_global_dtors_aux+0x2d>
  805e671:      83 c0 04                add    $0x4,%eax
  805e674:      a3 a8 84 12 08          mov    %eax,0x81284a8
  805e679:      ff d2                   call   *%edx

 and so forth.  My perl build uses constant instructions across the
multiple builds, and deletes the directory, otherwise I'd blame it
on user error.  Maybe glibc-2.5.1 is bringing something to the party
(what is this gmon_start ?), but in that case why doesn't it alter
both builds ?

 Is something we build after perl suddenly causing a difference ?
To be clear, for the first run I built chapter 6 then followed
through installing bootscripts because I do them in the same
script.  Then I saved it all, and later came back at the start
of chapter 6.

 The differences in libc look to me like the thin end of the wedge
for farce analysis (if I'm right about randomization, somebody else
will have to develop a tool to analyze it), but these perl
differences baffle me.

ĸen
-- 
das eine Mal als Tragödie, das andere Mal als Farce
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to