lkml.org 
[lkml]   [1997]   [May]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: pre-patch-2.1.37-3 comment / compile fixes
> helix,1:~/src/linux/arch/i386/lib% gcc -D__KERNEL__ -I/usr/src/linux/include -O6
> -c checksum.c
> /tmp/cca00480.s: Assembler messages:
> /tmp/cca00480.s:604: Fatal error: Symbol end_of_body already defined.

I've been looking into this and found that gcc will inline the
first function inside the second. Because the first function has inline
assembly which defines global symbols, you get duplicates. The fix is
to not define global labels in inline assembly.

I'm no expert on gas, so somebody correct me if I'm wrong. The gas
documentation says one can use [:digit:] as a local label, and
[:digit:][fb] as a forward or backward reference. It also points out
that you won't have more than 10 accessible forward or backward labels
at any time. From looking at the gas sources, it seems that one can use
any small number as a label, where a small number is defined to fit into
32 bits on x86. If this is correct, and I did not make other mistakes, the
patch below should go into arch/i386/lib/checksum.c. Also, somebody should
fix the gas documentation :-)

Regards,
Martin

--- /usr/src/linux/arch/i386/lib/checksum.c Fri Feb 7 14:54:54 1997
+++ checksum.c Sun May 4 02:31:13 1997
@@ -111,13 +111,13 @@
#define SRC(y...) \
" 9999: "#y"; \n \
.section __ex_table, \"a\"; \n \
- .long 9999b, src_access_fault \n \
+ .long 9999b, 10f \n \
.previous"

#define DST(y...) \
" 9999: "#y"; \n \
.section __ex_table, \"a\"; \n \
- .long 9999b, dst_access_fault \n \
+ .long 9999b, 11f \n \
.previous"

unsigned int csum_partial_copy_generic (const char *src, char *dst,
@@ -203,28 +203,28 @@
adcl $0, %%eax
7:

-end_of_body:
+ 8:

# Exception handler:
################################################
#
.section .fixup, \"a\" #
#
-common_fixup: #
+9: #
#
movl %7, (%%ebx) #
#
# FIXME: do zeroing of rest of the buffer here. #
#
- jmp end_of_body #
+ jmp 8b #
#
-src_access_fault: #
+10: #
movl %1, %%ebx #
- jmp common_fixup #
+ jmp 9b #
#
-dst_access_fault: #
+11: #
movl %2, %%ebx #
- jmp common_fixup #
+ jmp 9b #
#
.previous #
#
\
 
 \ /
  Last update: 2005-03-22 13:39    [W:0.035 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site