Skip to contentSkip to conversation

compile failure: pacache.S and .size

DISCUSSION Meelis Roos 2 participants 9 messages Mar 12, 2011 – Mar 20, 2011 PA-RISC architecture

lore
Share & tools
lore
#0 lore raw

This is todays 2.6.38-rc8+git on hppa64 with
(GNU Binutils for Debian) 2.21.0.20110302. Have not tried to build an earlier kernel with this binutils so I do not knwo if this is a regression but it looks more like a problem found by new binutils.

AS arch/parisc/kernel/pacache.o
arch/parisc/kernel/pacache.S: Assembler messages:
arch/parisc/kernel/pacache.S:1071: Error: .size expression does not evaluate to a constant

pacache.S line 1071 ends procedure disable_sr_hashing_asm and does seem to do it in normal way and without typos.

.procend
ENDPROC(disable_sr_hashing_asm)

.end

This preprocesses to

.procend
.size disable_sr_hashing_asm, .-disable_sr_hashing_asm

.end

and this seems fully normal to me. Other functions assemble fine here but the last one in file.

Signature · 1 line
Meelis Roos ([email protected])
#1 lore raw
Quoted 6 lines · Meelis Roos

This preprocesses to

.procend
.size disable_sr_hashing_asm, .-disable_sr_hashing_asm

.end

It looks to me like someone may have removed the necessary whitespace before .size in linkage.h. It may now be necessary for parisc to define its own version of END. Don't think this has anything to do with binutils.

Dave

Signature · 2 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
#2 lore raw
Quoted 10 lines
Quoted 6 lines

This preprocesses to

.procend
.size disable_sr_hashing_asm, .-disable_sr_hashing_asm

.end

It looks to me like someone may have removed the necessary whitespace before .size in linkage.h. It may now be necessary for parisc to define its own version of END. Don't think this has anything to do with binutils.

But the defines of ENDPROC and END in linkage.h are from 2006, commit ab7efcc9 from Jan Beulich. This has not changed, binutils has, thus my idea about binutils difference. However, I do not have the old binutils package easyly availbale right now so I can not test that today.

Signature · 1 line
Meelis Roos ([email protected])
#3 lore raw
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

This preprocesses to

.procend
.size disable_sr_hashing_asm, .-disable_sr_hashing_asm

.end

Quoted 8 lines
Quoted 3 lines

It looks to me like someone may have removed the necessary whitespace before .size in linkage.h. It may now be necessary for parisc to define its own version of END. Don't think this has anything to do with binutils.

But the defines of ENDPROC and END in linkage.h are from 2006, commit ab7efcc9 from Jan Beulich. This has not changed, binutils has, thus my idea about binutils difference. However, I do not have the old binutils package easyly availbale right now so I can not test that today.

I have not seen the problem with 2.21.51.20110218. .size is handled by generic code. I find it hard to believe that .-disable_sr_hashing_asm doesn't evaluate to a constant. GCC always outputs a similar directive. It would seem like almost every assembly would be broken if the problem was with binutils.

Could you send preprocessed assembler file?

Dave

Signature · 2 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
#4 lore raw
In reply to Meelis Roos
Quoted 7 lines · Meelis Roos
Quoted 7 lines
Quoted 6 lines

This preprocesses to

.procend
.size disable_sr_hashing_asm, .-disable_sr_hashing_asm

.end

Quoted 8 lines
Quoted 3 lines

It looks to me like someone may have removed the necessary whitespace before .size in linkage.h. It may now be necessary for parisc to define its own version of END. Don't think this has anything to do with binutils.

But the defines of ENDPROC and END in linkage.h are from 2006, commit ab7efcc9 from Jan Beulich. This has not changed, binutils has, thus my idea about binutils difference. However, I do not have the old binutils package easyly availbale right now so I can not test that today.

You are correct, there is a new error message for .size
http://sourceware.org/bugzilla/show_bug.cgi?id=12519
and the change was applied to the 2.21 branch.

The message was introduced because you can't size a function across two sections. It's not obvious why this is happening here. So, I think a binutils bug should be filed with preprocessed assembler.

Dave

Signature · 2 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
#5 lore raw
Quoted 7 lines

You are correct, there is a new error message for .size
http://sourceware.org/bugzilla/show_bug.cgi?id=12519
and the change was applied to the 2.21 branch.

The message was introduced because you can't size a function across two sections. It's not obvious why this is happening here. So, I think a binutils bug should be filed with preprocessed assembler.

http://sourceware.org/bugzilla/show_bug.cgi?id=12579 - also hase the preprocessed file.

Signature · 1 line
Meelis Roos ([email protected])
#6 lore raw
In reply to John David Anglin
Quoted 5 lines
Quoted 4 lines

But the defines of ENDPROC and END in linkage.h are from 2006, commit ab7efcc9 from Jan Beulich. This has not changed, binutils has, thus my idea about binutils difference. However, I do not have the old binutils package easyly availbale right now so I can not test that today.

Quoted 7 lines

You are correct, there is a new error message for .size
http://sourceware.org/bugzilla/show_bug.cgi?id=12519
and the change was applied to the 2.21 branch.

The message was introduced because you can't size a function across two sections. It's not obvious why this is happening here. So, I think a binutils bug should be filed with preprocessed assembler.

Got an answer from binutils bugzilla - we have a problem with ENDPROC(flush_alias_page)
that is not started because the start is #if 0 but end is not. I did not understand clearly what the code intends to do but it looks there are just two independent functions that should have their start and end matched. Made a test patch to try that out, makes it compile, will test boot soon.

arch/parisc/kernel/pacache.S +1 -1
index 09b77b2..f3d7da6 100644
@@ -842,11 +842,10 @@ ENTRY(flush_alias_page)
 	.exit
 
 	.procend
+ENDPROC(flush_alias_page)
 #endif
 
-	.export flush_user_dcache_range_asm
#7 lore raw
Quoted 2 lines · Meelis Roos

Got an answer from binutils bugzilla - we have a problem with ENDPROC(flush_alias_page)

I thought the flush_alias_page code was deleted.

It would appear the tmpalias-flush changes from James are not merged in Linus' kernel tree. It seems to have gone into linux-next here:
http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=commitdiff;h=f311847c2fcebd81912e2f0caf8a461dec28db41

Your patch should fix the compilation problem but I think we really want James' tmpalias-flush changes in 2.6.28 based on my testing. Maybe it should be applied to some of the stable branches.

Dave

Signature · 2 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
#8 lore raw
In reply to Meelis Roos
Quoted 19 lines · Meelis Roos
arch/parisc/kernel/pacache.S +2 -3
index 09b77b2..f3d7da6 100644
@@ -842,11 +842,10 @@ ENTRY(flush_alias_page)
 	.exit
 
 	.procend
+ENDPROC(flush_alias_page)
 #endif
 
-	.export flush_user_dcache_range_asm
-
-flush_user_dcache_range_asm:
+ENTRY(flush_user_dcache_range_asm)
 	.proc
 	.callinfo NO_CALLS
 	.entry

arch/parisc/kernel/pacache.S flush_user_dcache_range_asm: · line 870

Quoted 8 lines
arch/parisc/kernel/pacache.S +1 -1
@@ -865,7 +864,7 @@ flush_user_dcache_range_asm:
 	.exit
 
 	.procend
-ENDPROC(flush_alias_page)
+ENDPROC(flush_user_dcache_range_asm)
 
 ENTRY(flush_kernel_dcache_range_asm)
 	.proc

Suggest officially submitting above change. It corrects obvious problems with pacache.S.

Dave

Signature · 2 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)