This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

m68k floating point overwrites vector table


Not sure if this is a bug or not, but when compiling for
target=m68k-coff, my exception vector table is overwritten.

gcc 2.95.2
binutils 2.10.1
target=m68k-coff, MC68331

It looks like this is all happening in the software floating point
library.  I linked to $M68KPATH/lib/gcc-lib/m68k-coff/2.95.2/libgcc.a
when compiling for my target.

In the file gcc/config/m68k/lb1sf68.asm,
it appears something like:
ROUND_TO_NEAREST  = 0 | round result to nearest representable value
Was making a symbol ROUNDT_TO_NEARETST at addreess 0x0.

Changing all these assignments to the following seemed to solve the problem.
.set ROUND_TO_NEAREST  , 0 | round result to nearest representable value

My linker script:
SECTIONS
{
        . = 0x4000;
        .text : { *(.text) }
        . = 0x15000;
        .data : { *(.data) }
        .bss : { *(.bss) }
}

Anyone experience this problem and is this a bug?

--- ./lb1sf68.asm	Mon Mar  1 10:06:44 1999
+++ ../../../../gccn/cd/gcc/gcc/config/m68k/lb1sf68.asm	Wed Mar 14 18:31:22 2001
@@ -145,11 +145,11 @@
 __sticky_bits:
 	.word	0
 __rounding_mode:
-	.word	ROUND_TO_NEAREST
+	.word	0
 __format:
-	.word	NIL
+	.word	0
 __last_operation:
-	.word	NOOP
+	.word	0
 __operand1:
 	.long	0
 	.long	0
@@ -158,44 +158,44 @@
 	.long	0
 
 | Offsets:
-EBITS  = __exception_bits - SYM (_fpCCR)
-TRAPE  = __trap_enable_bits - SYM (_fpCCR)
-STICK  = __sticky_bits - SYM (_fpCCR)
-ROUND  = __rounding_mode - SYM (_fpCCR)
-FORMT  = __format - SYM (_fpCCR)
-LASTO  = __last_operation - SYM (_fpCCR)
-OPER1  = __operand1 - SYM (_fpCCR)
-OPER2  = __operand2 - SYM (_fpCCR)
+.set EBITS  , __exception_bits - SYM (_fpCCR)
+.set TRAPE  , __trap_enable_bits - SYM (_fpCCR)
+.set STICK  , __sticky_bits - SYM (_fpCCR)
+.set ROUND  , __rounding_mode - SYM (_fpCCR)
+.set FORMT  , __format - SYM (_fpCCR)
+.set LASTO  , __last_operation - SYM (_fpCCR)
+.set OPER1  , __operand1 - SYM (_fpCCR)
+.set OPER2  , __operand2 - SYM (_fpCCR)
 
 | The following exception types are supported:
-INEXACT_RESULT 		= 0x0001
-UNDERFLOW 		= 0x0002
-OVERFLOW 		= 0x0004
-DIVIDE_BY_ZERO 		= 0x0008
-INVALID_OPERATION 	= 0x0010
+.set INEXACT_RESULT 		, 0x0001
+.set UNDERFLOW 		, 0x0002
+.set OVERFLOW 		, 0x0004
+.set DIVIDE_BY_ZERO 		, 0x0008
+.set INVALID_OPERATION 	, 0x0010
 
 | The allowed rounding modes are:
-UNKNOWN           = -1
-ROUND_TO_NEAREST  = 0 | round result to nearest representable value
-ROUND_TO_ZERO     = 1 | round result towards zero
-ROUND_TO_PLUS     = 2 | round result towards plus infinity
-ROUND_TO_MINUS    = 3 | round result towards minus infinity
+.set UNKNOWN           , -1
+.set ROUND_TO_NEAREST  , 0 | round result to nearest representable value
+.set ROUND_TO_ZERO     , 1 | round result towards zero
+.set ROUND_TO_PLUS     , 2 | round result towards plus infinity
+.set ROUND_TO_MINUS    , 3 | round result towards minus infinity
 
 | The allowed values of format are:
-NIL          = 0
-SINGLE_FLOAT = 1
-DOUBLE_FLOAT = 2
-LONG_FLOAT   = 3
+.set NIL          , 0
+.set SINGLE_FLOAT , 1
+.set DOUBLE_FLOAT , 2
+.set LONG_FLOAT   , 3
 
 | The allowed values for the last operation are:
-NOOP         = 0
-ADD          = 1
-MULTIPLY     = 2
-DIVIDE       = 3
-NEGATE       = 4
-COMPARE      = 5
-EXTENDSFDF   = 6
-TRUNCDFSF    = 7
+.set NOOP         , 0
+.set ADD          , 1
+.set MULTIPLY     , 2
+.set DIVIDE       , 3
+.set NEGATE       , 4
+.set COMPARE      , 5
+.set EXTENDSFDF   , 6
+.set TRUNCDFSF    , 7
 
 |=============================================================================
 |                           __clear_sticky_bits
@@ -243,7 +243,7 @@
 | in which case it pushes the address of _fpCCR and traps through 
 | trap FPTRAP (15 for the moment).
 
-FPTRAP = 15
+.set FPTRAP , 15
 
 $_exception_handler:
 	lea	SYM (_fpCCR),a0
@@ -490,36 +490,36 @@
 	.globl	SYM (_fpCCR)
 	.globl  $_exception_handler
 
-QUIET_NaN      = 0xffffffff
+.set QUIET_NaN      , 0xffffffff
 
-D_MAX_EXP      = 0x07ff
-D_BIAS         = 1022
-DBL_MAX_EXP    = D_MAX_EXP - D_BIAS
-DBL_MIN_EXP    = 1 - D_BIAS
-DBL_MANT_DIG   = 53
-
-INEXACT_RESULT 		= 0x0001
-UNDERFLOW 		= 0x0002
-OVERFLOW 		= 0x0004
-DIVIDE_BY_ZERO 		= 0x0008
-INVALID_OPERATION 	= 0x0010
-
-DOUBLE_FLOAT = 2
-
-NOOP         = 0
-ADD          = 1
-MULTIPLY     = 2
-DIVIDE       = 3
-NEGATE       = 4
-COMPARE      = 5
-EXTENDSFDF   = 6
-TRUNCDFSF    = 7
-
-UNKNOWN           = -1
-ROUND_TO_NEAREST  = 0 | round result to nearest representable value
-ROUND_TO_ZERO     = 1 | round result towards zero
-ROUND_TO_PLUS     = 2 | round result towards plus infinity
-ROUND_TO_MINUS    = 3 | round result towards minus infinity
+.set D_MAX_EXP      , 0x07ff
+.set D_BIAS         , 1022
+.set DBL_MAX_EXP    , D_MAX_EXP - D_BIAS
+.set DBL_MIN_EXP    , 1 - D_BIAS
+.set DBL_MANT_DIG   , 53
+
+.set INEXACT_RESULT 		, 0x0001
+.set UNDERFLOW 		, 0x0002
+.set OVERFLOW 		, 0x0004
+.set DIVIDE_BY_ZERO 		, 0x0008
+.set INVALID_OPERATION 	, 0x0010
+
+.set DOUBLE_FLOAT , 2
+
+.set NOOP         , 0
+.set ADD          , 1
+.set MULTIPLY     , 2
+.set DIVIDE       , 3
+.set NEGATE       , 4
+.set COMPARE      , 5
+.set EXTENDSFDF   , 6
+.set TRUNCDFSF    , 7
+
+.set UNKNOWN           , -1
+.set ROUND_TO_NEAREST  , 0 | round result to nearest representable value
+.set ROUND_TO_ZERO     , 1 | round result towards zero
+.set ROUND_TO_PLUS     , 2 | round result towards plus infinity
+.set ROUND_TO_MINUS    , 3 | round result towards minus infinity
 
 | Entry points:
 
@@ -2144,9 +2144,9 @@
 |                              __cmpdf2
 |=============================================================================
 
-GREATER =  1
-LESS    = -1
-EQUAL   =  0
+.set GREATER ,  1
+.set LESS    , -1
+.set EQUAL   ,  0
 
 | int __cmpdf2(double, double);
 SYM (__cmpdf2):
@@ -2372,38 +2372,38 @@
 	.globl	SYM (_fpCCR)
 	.globl  $_exception_handler
 
-QUIET_NaN    = 0xffffffff
-SIGNL_NaN    = 0x7f800001
-INFINITY     = 0x7f800000
-
-F_MAX_EXP      = 0xff
-F_BIAS         = 126
-FLT_MAX_EXP    = F_MAX_EXP - F_BIAS
-FLT_MIN_EXP    = 1 - F_BIAS
-FLT_MANT_DIG   = 24
-
-INEXACT_RESULT 		= 0x0001
-UNDERFLOW 		= 0x0002
-OVERFLOW 		= 0x0004
-DIVIDE_BY_ZERO 		= 0x0008
-INVALID_OPERATION 	= 0x0010
-
-SINGLE_FLOAT = 1
-
-NOOP         = 0
-ADD          = 1
-MULTIPLY     = 2
-DIVIDE       = 3
-NEGATE       = 4
-COMPARE      = 5
-EXTENDSFDF   = 6
-TRUNCDFSF    = 7
-
-UNKNOWN           = -1
-ROUND_TO_NEAREST  = 0 | round result to nearest representable value
-ROUND_TO_ZERO     = 1 | round result towards zero
-ROUND_TO_PLUS     = 2 | round result towards plus infinity
-ROUND_TO_MINUS    = 3 | round result towards minus infinity
+.set QUIET_NaN    , 0xffffffff
+.set SIGNL_NaN    , 0x7f800001
+.set INFINITY     , 0x7f800000
+
+.set F_MAX_EXP      , 0xff
+.set F_BIAS         , 126
+.set FLT_MAX_EXP    , F_MAX_EXP - F_BIAS
+.set FLT_MIN_EXP    , 1 - F_BIAS
+.set FLT_MANT_DIG   , 24
+
+.set INEXACT_RESULT 		, 0x0001
+.set UNDERFLOW 		, 0x0002
+.set OVERFLOW 		, 0x0004
+.set DIVIDE_BY_ZERO 		, 0x0008
+.set INVALID_OPERATION 	, 0x0010
+
+.set SINGLE_FLOAT , 1
+
+.set NOOP         , 0
+.set ADD          , 1
+.set MULTIPLY     , 2
+.set DIVIDE       , 3
+.set NEGATE       , 4
+.set COMPARE      , 5
+.set EXTENDSFDF   , 6
+.set TRUNCDFSF    , 7
+
+.set UNKNOWN           , -1
+.set ROUND_TO_NEAREST  , 0 | round result to nearest representable value
+.set ROUND_TO_ZERO     , 1 | round result towards zero
+.set ROUND_TO_PLUS     , 2 | round result towards plus infinity
+.set ROUND_TO_MINUS    , 3 | round result towards minus infinity
 
 | Entry points:
 
@@ -3552,9 +3552,9 @@
 |                             __cmpsf2
 |=============================================================================
 
-GREATER =  1
-LESS    = -1
-EQUAL   =  0
+.set GREATER ,  1
+.set LESS    , -1
+.set EQUAL   ,  0
 
 | int __cmpsf2(float, float);
 SYM (__cmpsf2):

-- 
- Nick

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]