kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* #if 0
@ 2008-01-27 23:10 Paolo Ciarrocchi
  2008-01-27 23:29 ` Bert Wesarg
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Paolo Ciarrocchi @ 2008-01-27 23:10 UTC (permalink / raw)
  To: kernel-janitors

Hi all,
I'm failing to understand why the following patch is changing the md5sum
of the relative .o file

-#if 0
-void Un_impl(void)
-{
-  u_char byte1, FPU_modrm;
-  unsigned long address = FPU_ORIG_EIP;
-
-  RE_ENTRANT_CHECK_OFF;
-  /* No need to check access_ok(), we have previously fetched these bytes. */
-  printk("Unimplemented FPU Opcode at eip=%p : ", (void __user *) address);
-  if ( FPU_CS = __USER_CS )
-    {
-      while ( 1 )
-       {
-         FPU_get_user(byte1, (u_char __user *) address);
-         if ( (byte1 & 0xf8) = 0xd8 ) break;
-         printk("[%02x]", byte1);
-         address++;
-       }
-      printk("%02x ", byte1);
-      FPU_get_user(FPU_modrm, 1 + (u_char __user *) address);
-
-      if (FPU_modrm >= 0300)
-       printk("%02x (%02x+%d)\n", FPU_modrm, FPU_modrm & 0xf8, FPU_modrm & 7);
-      else
-       printk("/%d\n", (FPU_modrm >> 3) & 7);
-    }
-  else
-    {
-      printk("cs selector = %04x\n", FPU_CS);
-    }
-
-  RE_ENTRANT_CHECK_ON;
-
-  EXCEPTION(EX_Invalid);
-
-}
-#endif  /*  0  */

Isn't the code included in the #if 0 #endif section supposed to be
ignored by the compiler?

I'm compiling as follow:
make clean && make arch/x86/math-emu/errors.o
before and after the patch.
And comparing the md5sum of the two .o files using the md5sum command.

Thanks!

Ciao,
-- 
Paolo
http://paolo.ciarrocchi.googlepages.com/

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

* Re: #if 0
  2008-01-27 23:10 #if 0 Paolo Ciarrocchi
@ 2008-01-27 23:29 ` Bert Wesarg
  2008-01-27 23:55 ` Paolo Ciarrocchi
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Bert Wesarg @ 2008-01-27 23:29 UTC (permalink / raw)
  To: kernel-janitors

Hi,

On Jan 28, 2008 12:10 AM, Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> wrote:
> Hi all,
> I'm failing to understand why the following patch is changing the md5sum
> of the relative .o file
>
> Isn't the code included in the #if 0 #endif section supposed to be
> ignored by the compiler?
Yes, but I think the line numbers changes too and are also in the .o file.

Bert
>
> I'm compiling as follow:
> make clean && make arch/x86/math-emu/errors.o
> before and after the patch.
> And comparing the md5sum of the two .o files using the md5sum command.
>
> Thanks!
>
> Ciao,
> --
> Paolo

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

* Re: #if 0
  2008-01-27 23:10 #if 0 Paolo Ciarrocchi
  2008-01-27 23:29 ` Bert Wesarg
@ 2008-01-27 23:55 ` Paolo Ciarrocchi
  2008-01-28  0:03 ` Bert Wesarg
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Paolo Ciarrocchi @ 2008-01-27 23:55 UTC (permalink / raw)
  To: kernel-janitors

On Jan 28, 2008 12:29 AM, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> Hi,
>
> On Jan 28, 2008 12:10 AM, Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> wrote:
> > Hi all,
> > I'm failing to understand why the following patch is changing the md5sum
> > of the relative .o file
> >
> > Isn't the code included in the #if 0 #endif section supposed to be
> > ignored by the compiler?
> Yes, but I think the line numbers changes too and are also in the .o file.

Dunno, but stripping the file make md5sum as follow:
paolo@paolo-desktop:~/linux-2.6/kernel$ strip
/home/paolo/Desktop/File\ punto\ o/*
paolo@paolo-desktop:~/linux-2.6/kernel$ md5sum
/home/paolo/Desktop/File\ punto\ o/*
2bf404e247edf33cf6fb99c37321cdb9  /home/paolo/Desktop/File punto o/error.o.after
2bf404e247edf33cf6fb99c37321cdb9  /home/paolo/Desktop/File punto
o/error.o.before

Ciao,
-- 
Paolo
http://paolo.ciarrocchi.googlepages.com/

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

* Re: #if 0
  2008-01-27 23:10 #if 0 Paolo Ciarrocchi
  2008-01-27 23:29 ` Bert Wesarg
  2008-01-27 23:55 ` Paolo Ciarrocchi
@ 2008-01-28  0:03 ` Bert Wesarg
  2008-01-28  0:08 ` Paolo Ciarrocchi
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Bert Wesarg @ 2008-01-28  0:03 UTC (permalink / raw)
  To: kernel-janitors

On Jan 28, 2008 12:55 AM, Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> wrote:
> On Jan 28, 2008 12:29 AM, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> > Hi,
> >
> > On Jan 28, 2008 12:10 AM, Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> wrote:
> > > Hi all,
> > > I'm failing to understand why the following patch is changing the md5sum
> > > of the relative .o file
> > >
> > > Isn't the code included in the #if 0 #endif section supposed to be
> > > ignored by the compiler?
> > Yes, but I think the line numbers changes too and are also in the .o file.
>
> Dunno, but stripping the file make md5sum as follow:
> paolo@paolo-desktop:~/linux-2.6/kernel$ strip
> /home/paolo/Desktop/File\ punto\ o/*
> paolo@paolo-desktop:~/linux-2.6/kernel$ md5sum
> /home/paolo/Desktop/File\ punto\ o/*
> 2bf404e247edf33cf6fb99c37321cdb9  /home/paolo/Desktop/File punto o/error.o.after
> 2bf404e247edf33cf6fb99c37321cdb9  /home/paolo/Desktop/File punto
> o/error.o.before
Perfect. What was your problem?

Bert
>
>
> Ciao,
> --
> Paolo
> http://paolo.ciarrocchi.googlepages.com/
>

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

* Re: #if 0
  2008-01-27 23:10 #if 0 Paolo Ciarrocchi
                   ` (2 preceding siblings ...)
  2008-01-28  0:03 ` Bert Wesarg
@ 2008-01-28  0:08 ` Paolo Ciarrocchi
  2008-01-28  0:18 ` Bert Wesarg
  2008-01-28  8:34 ` Adrian Bunk
  5 siblings, 0 replies; 7+ messages in thread
From: Paolo Ciarrocchi @ 2008-01-28  0:08 UTC (permalink / raw)
  To: kernel-janitors

On Jan 28, 2008 1:03 AM, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
>
> On Jan 28, 2008 12:55 AM, Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> wrote:
> > On Jan 28, 2008 12:29 AM, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> > > Hi,
> > >
> > > On Jan 28, 2008 12:10 AM, Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> wrote:
> > > > Hi all,
> > > > I'm failing to understand why the following patch is changing the md5sum
> > > > of the relative .o file
> > > >
> > > > Isn't the code included in the #if 0 #endif section supposed to be
> > > > ignored by the compiler?
> > > Yes, but I think the line numbers changes too and are also in the .o file.
> >
> > Dunno, but stripping the file make md5sum as follow:
> > paolo@paolo-desktop:~/linux-2.6/kernel$ strip
> > /home/paolo/Desktop/File\ punto\ o/*
> > paolo@paolo-desktop:~/linux-2.6/kernel$ md5sum
> > /home/paolo/Desktop/File\ punto\ o/*
> > 2bf404e247edf33cf6fb99c37321cdb9  /home/paolo/Desktop/File punto o/error.o.after
> > 2bf404e247edf33cf6fb99c37321cdb9  /home/paolo/Desktop/File punto
> > o/error.o.before
> Perfect. What was your problem?

The problem was that I didn't expect to see different md5sum after removing
some dead code.

I'm working on a series of cleanup patches and I want to be sure that
I'm NOT changing
the .o file. I want to be sure that every single patch is just
cleaning the code.

What I wanted to do was:
make a/b/c.o
md5sum a/b/c.o
applying the first patch
make clean && make a/b/c.o
md5sum a/b/c.o
and so on.

Should I add the strip command to the procedure?
And if yes... why?

Thanks!

Ciao,
-- 
Paolo
http://paolo.ciarrocchi.googlepages.com/

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

* Re: #if 0
  2008-01-27 23:10 #if 0 Paolo Ciarrocchi
                   ` (3 preceding siblings ...)
  2008-01-28  0:08 ` Paolo Ciarrocchi
@ 2008-01-28  0:18 ` Bert Wesarg
  2008-01-28  8:34 ` Adrian Bunk
  5 siblings, 0 replies; 7+ messages in thread
From: Bert Wesarg @ 2008-01-28  0:18 UTC (permalink / raw)
  To: kernel-janitors

> > Perfect. What was your problem?
>
> The problem was that I didn't expect to see different md5sum after removing
> some dead code.
>
> I'm working on a series of cleanup patches and I want to be sure that
> I'm NOT changing
> the .o file. I want to be sure that every single patch is just
> cleaning the code.
>
> What I wanted to do was:
> make a/b/c.o
> md5sum a/b/c.o
> applying the first patch
> make clean && make a/b/c.o
> md5sum a/b/c.o
> and so on.
>
> Should I add the strip command to the procedure?
> And if yes... why?
If you want to use md5sum, than yes, because of the debug information
inside the .o, and this includes line numbers, and these will change,
if you remove dead code.

You can look at the elfcmp tool. But I have no experience with this tool.

Bert
>
> Thanks!
>
>
> Ciao,
> --
> Paolo
> http://paolo.ciarrocchi.googlepages.com/
>

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

* Re: #if 0
  2008-01-27 23:10 #if 0 Paolo Ciarrocchi
                   ` (4 preceding siblings ...)
  2008-01-28  0:18 ` Bert Wesarg
@ 2008-01-28  8:34 ` Adrian Bunk
  5 siblings, 0 replies; 7+ messages in thread
From: Adrian Bunk @ 2008-01-28  8:34 UTC (permalink / raw)
  To: kernel-janitors

On Mon, Jan 28, 2008 at 12:10:32AM +0100, Paolo Ciarrocchi wrote:

> Hi all,

Hi Paolo,

> I'm failing to understand why the following patch is changing the md5sum
> of the relative .o file
>...

it should stay the same if you disable CONFIG_DEBUG_INFO in your .config.

> Thanks!
> 
> Ciao,

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


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

end of thread, other threads:[~2008-01-28  8:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-27 23:10 #if 0 Paolo Ciarrocchi
2008-01-27 23:29 ` Bert Wesarg
2008-01-27 23:55 ` Paolo Ciarrocchi
2008-01-28  0:03 ` Bert Wesarg
2008-01-28  0:08 ` Paolo Ciarrocchi
2008-01-28  0:18 ` Bert Wesarg
2008-01-28  8:34 ` Adrian Bunk

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 NNTP newsgroup(s).