public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Re: [discuss] RE: [PATCH] [1/2] x86_64: Pass -32 to the assembler when compiling  the 32bit vsyscall pages
       [not found] <6095103C4F0ACD4FAE3522E0F27ADF42022CEE33@cceexc13.americas.cpqcorp.net>
@ 2006-04-21 23:22 ` H. J. Lu
  2006-04-23 20:24   ` Andi Kleen
  0 siblings, 1 reply; 4+ messages in thread
From: H. J. Lu @ 2006-04-21 23:22 UTC (permalink / raw)
  To: Baker, Brian (ISS - Houston)
  Cc: ak, torvalds, discuss, akpm, Altobelli, David, binutils

On Fri, Apr 21, 2006 at 09:25:33AM -0500, Baker, Brian (ISS - Houston) wrote:
> The credit for this should actually go to Dave Altobelli, not myself.
> 
> -----Original Message-----
> From: ak@suse.de [mailto:ak@suse.de] 
> Sent: Friday, April 21, 2006 2:42 AM
> To: torvalds@osdl.org
> Cc: discuss@x86-64.org; akpm@osdl.org; Baker, Brian (ISS - Houston)
> Subject: [PATCH] [1/2] x86_64: Pass -32 to the assembler when compiling
> the 32bit vsyscall pages
> 
> 
> This quietens warnings and actually fixes a bug. The unwind tables would
> come out wrong without -32, causing pthread cancellation during them 
> to crash in the gcc runtime.
> 
> The problem seems to only happen with newer binutils
> (it doesn't happen with 2.16.91.0.2 but happens wit 2.16.91.0.5) 

If you believe it is true, please open a bug report at

http://www.sourceware.org/bugzilla/

> 
> Thanks to Brian Baker @ HP for test case and initial analysis.
> 
> Cc: brian.b@hp.com
> 
> Signed-off-by: Andi Kleen <ak@suse.de>
> 
> ---
>  arch/x86_64/ia32/Makefile |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> Index: linux/arch/x86_64/ia32/Makefile
> ===================================================================
> --- linux.orig/arch/x86_64/ia32/Makefile
> +++ linux/arch/x86_64/ia32/Makefile
> @@ -27,5 +27,5 @@ $(obj)/vsyscall-sysenter.so $(obj)/vsysc
>  $(obj)/vsyscall-%.so: $(src)/vsyscall.lds $(obj)/vsyscall-%.o FORCE
>  	$(call if_changed,syscall)
>  
> -AFLAGS_vsyscall-sysenter.o = -m32
> -AFLAGS_vsyscall-syscall.o = -m32
> +AFLAGS_vsyscall-sysenter.o = -m32 -Wa,-32
> +AFLAGS_vsyscall-syscall.o = -m32 -Wa,-32

I can't reproduce it with binutils 2.16.91.0.5. Unless you have a bad
gcc driver, -m32 will pass --32 to assembler, which is the same as -32.


H.J.

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

* Re: [discuss] RE: [PATCH] [1/2] x86_64: Pass -32 to the assembler when compiling  the 32bit vsyscall pages
  2006-04-21 23:22 ` [discuss] RE: [PATCH] [1/2] x86_64: Pass -32 to the assembler when compiling the 32bit vsyscall pages H. J. Lu
@ 2006-04-23 20:24   ` Andi Kleen
  2006-04-24 10:13     ` H. J. Lu
  0 siblings, 1 reply; 4+ messages in thread
From: Andi Kleen @ 2006-04-23 20:24 UTC (permalink / raw)
  To: discuss
  Cc: H. J. Lu, Baker, Brian (ISS - Houston),
	torvalds, akpm, Altobelli, David, binutils


> > Index: linux/arch/x86_64/ia32/Makefile
> > ===================================================================
> > --- linux.orig/arch/x86_64/ia32/Makefile
> > +++ linux/arch/x86_64/ia32/Makefile
> > @@ -27,5 +27,5 @@ $(obj)/vsyscall-sysenter.so $(obj)/vsysc
> >  $(obj)/vsyscall-%.so: $(src)/vsyscall.lds $(obj)/vsyscall-%.o FORCE
> >  	$(call if_changed,syscall)
> >
> > -AFLAGS_vsyscall-sysenter.o = -m32
> > -AFLAGS_vsyscall-syscall.o = -m32
> > +AFLAGS_vsyscall-sysenter.o = -m32 -Wa,-32
> > +AFLAGS_vsyscall-syscall.o = -m32 -Wa,-32
>
> I can't reproduce it

What did you try exactly? 

You have to recompile the file and either run the pthreads
cancellation test case with the right glibc version, or examine
the unwind tables in the .so by hand. Or just check if the warning
appears or not.

> with binutils 2.16.91.0.5. Unless you have a bad 
> gcc driver, -m32 will pass --32 to assembler, which is the same as -32.

It definitely fixed the problem here and the warning went away.
gcc used was 4.1

But you're right it could have been the gcc - in the case where it worked
I was using gcc 4.0.

-Andi

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

* Re: [discuss] RE: [PATCH] [1/2] x86_64: Pass -32 to the assembler when compiling  the 32bit vsyscall pages
  2006-04-23 20:24   ` Andi Kleen
@ 2006-04-24 10:13     ` H. J. Lu
  2006-04-24 10:33       ` Andi Kleen
  0 siblings, 1 reply; 4+ messages in thread
From: H. J. Lu @ 2006-04-24 10:13 UTC (permalink / raw)
  To: Andi Kleen
  Cc: discuss, Baker, Brian (ISS - Houston),
	torvalds, akpm, Altobelli, David, binutils

On Sat, Apr 22, 2006 at 12:25:52AM +0200, Andi Kleen wrote:
> 
> > > Index: linux/arch/x86_64/ia32/Makefile
> > > ===================================================================
> > > --- linux.orig/arch/x86_64/ia32/Makefile
> > > +++ linux/arch/x86_64/ia32/Makefile
> > > @@ -27,5 +27,5 @@ $(obj)/vsyscall-sysenter.so $(obj)/vsysc
> > >  $(obj)/vsyscall-%.so: $(src)/vsyscall.lds $(obj)/vsyscall-%.o FORCE
> > >  	$(call if_changed,syscall)
> > >
> > > -AFLAGS_vsyscall-sysenter.o = -m32
> > > -AFLAGS_vsyscall-syscall.o = -m32
> > > +AFLAGS_vsyscall-sysenter.o = -m32 -Wa,-32
> > > +AFLAGS_vsyscall-syscall.o = -m32 -Wa,-32
> >
> > I can't reproduce it
> 
> What did you try exactly? 

I compared the outputs of vsyscall-sysenter.o with -m32 and -m32
-Wa,-32, using gcc 3.4. They are identical.

> 
> You have to recompile the file and either run the pthreads
> cancellation test case with the right glibc version, or examine
> the unwind tables in the .so by hand. Or just check if the warning
> appears or not.

There is no need to do that. If you believe the problem is due to
binutils 2.16.91.0.5, it is a binutils bug. Please open a bug report
at

http://www.sourceware.org/bugzilla/

and assign it to me. I need the preprocessed .s file, the expected .o
file and the expected .so file with procedures to reproduce the
difference. Since they are assembly codes, I will expect -m32 and
-m32 -Wa,-32 should generate the same output.

> 
> > with binutils 2.16.91.0.5. Unless you have a bad 
> > gcc driver, -m32 will pass --32 to assembler, which is the same as -32.
> 
> It definitely fixed the problem here and the warning went away.
> gcc used was 4.1
> 
> But you're right it could have been the gcc - in the case where it worked
> I was using gcc 4.0.
> 

Since they are assembly codes, it sounds like a gcc driver issue to me.


H.J.

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

* Re: [discuss] RE: [PATCH] [1/2] x86_64: Pass -32 to the assembler when compiling  the 32bit vsyscall pages
  2006-04-24 10:13     ` H. J. Lu
@ 2006-04-24 10:33       ` Andi Kleen
  0 siblings, 0 replies; 4+ messages in thread
From: Andi Kleen @ 2006-04-24 10:33 UTC (permalink / raw)
  To: H. J. Lu
  Cc: discuss, Baker, Brian (ISS - Houston),
	torvalds, akpm, Altobelli, David, binutils

On Saturday 22 April 2006 01:32, H. J. Lu wrote:

> > You have to recompile the file and either run the pthreads
> > cancellation test case with the right glibc version, or examine
> > the unwind tables in the .so by hand. Or just check if the warning
> > appears or not.
> 
> There is no need to do that. If you believe the problem is due to
> binutils 2.16.91.0.5, it is a binutils bug. Please open a bug report
> at

I'm not sure - it is reasonable for binutils to expect --32 to be passed
And the linker did warn about it after all - just I made the mistake
of ignoring it before.

The only reason I mentioned binutils is that it didn't happen with 
older binutils/gcc releases.

> 
> http://www.sourceware.org/bugzilla/
> 
> and assign it to me. I need the preprocessed .s file, the expected .o
> file and the expected .so file with procedures to reproduce the
> difference. Since they are assembly codes, I will expect -m32 and
> -m32 -Wa,-32 should generate the same output.

I don't have time to extract a test case out of this right now, sorry.
I guess you could though.

> 
> > 
> > > with binutils 2.16.91.0.5. Unless you have a bad 
> > > gcc driver, -m32 will pass --32 to assembler, which is the same as -32.
> > 
> > It definitely fixed the problem here and the warning went away.
> > gcc used was 4.1
> > 
> > But you're right it could have been the gcc - in the case where it worked
> > I was using gcc 4.0.
> > 
> 
> Since they are assembly codes, it sounds like a gcc driver issue to me.

Might be. The way the assembly is built is a bit funky because it's a 
shared library.

-Andi

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

end of thread, other threads:[~2006-04-21 23:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <6095103C4F0ACD4FAE3522E0F27ADF42022CEE33@cceexc13.americas.cpqcorp.net>
2006-04-21 23:22 ` [discuss] RE: [PATCH] [1/2] x86_64: Pass -32 to the assembler when compiling the 32bit vsyscall pages H. J. Lu
2006-04-23 20:24   ` Andi Kleen
2006-04-24 10:13     ` H. J. Lu
2006-04-24 10:33       ` Andi Kleen

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).