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]

test case: m68k symbol bug!


Here we go.  First off lets review the 'as' info node:
--- SNIP ---
   A symbol can be given an arbitrary value by writing a symbol,
followed by an equals sign `=', followed by an expression (*note
Expressions::).  This is equivalent to using the `.set' directive.
*Note `.set': Set.  
--- SNIP ---

Translation: set and = should do the same thing.

TEST CASE:
* Now the bug, at least I think:
[nick@h0050bad6338d test]$ more test2.S
/*
 * these are offsets into the task-struct
 */
LTASK_STATE     =  0
LTASK_COUNTER   =  4
LTASK_PRIORITY  =  8
LTASK_SIGNAL    = 12
LTASK_BLOCKED   = 16
LTASK_FLAGS     = 20

LD0             = 0x1C
LORIG_D0        = 0x20
LSR             = 0x28
LFORMATVEC      = 0x2E

[nick@h0050bad6338d test]$ m68k-coff-as test2.S -o test
[nick@h0050bad6338d test]$ m68k-coff-nm test
00000000 b .bss
00000000 d .data
00000000 t .text
0000001c a LD0
0000002e a LFORMATVEC
00000020 a LORIG_D0
00000028 a LSR
00000010 a LTASK_BLOCKED
00000004 a LTASK_COUNTER
00000014 a LTASK_FLAGS
00000008 a LTASK_PRIORITY
0000000c a LTASK_SIGNAL
00000000 a LTASK_STATE

* WHY ARE THESE OFFSETS BEING MAPPED INTO THE COFF FILE?


* Now the fix?:

[nick@h0050bad6338d test]$ more test.S
/*
 * these are offsets into the task-struct
 */
.set LTASK_STATE        ,  0
.set LTASK_COUNTER      ,  4
.set LTASK_PRIORITY     ,  8
.set LTASK_SIGNAL       , 12
.set LTASK_BLOCKED      , 16
.set LTASK_FLAGS        , 20

.set LD0                , 0x1C
.set LORIG_D0           , 0x20
.set LSR                , 0x28
.set LFORMATVEC         , 0x2E

[nick@h0050bad6338d test]$ m68k-coff-as test.S -o test
[nick@h0050bad6338d test]$ m68k-coff-nm test
00000000 b .bss
00000000 d .data
00000000 t .text



If .set and = do the same thing, why are they resulting in different
symbol tables?

Any insight much appreciated.

- Nick Papadonis

-- 
- Nick


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