home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / gnu / utils / bug / 2053 < prev    next >
Encoding:
Text File  |  1992-11-12  |  2.3 KB  |  90 lines

  1. Newsgroups: gnu.utils.bug
  2. Path: sparky!uunet!convex!news.utdallas.edu!wupost!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!sctc.com!scott
  3. From: scott@sctc.com (Scott Hammond)
  4. Subject: possible bug in gas-1.38 (m68k configuration)
  5. Message-ID: <9211130134.AA19259@SCTC.COM>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Fri, 13 Nov 1992 01:34:11 GMT
  10. Approved: bug-gnu-utils@prep.ai.mit.edu
  11. Lines: 77
  12.  
  13. Configuration:  gas-1.38(.1?) m68k.h->m-generic.h
  14.                 assember is used for cross-assembly
  15.                 host: sun4, sunos4.1.2
  16.                 gas run with no options.
  17.  
  18. It appears there is a bug in gas.  In this hand coded routine, the
  19. 'movw' and 'jmp' instructions show the wrong address for 'jtab' in the
  20. disassembly.
  21.  
  22. ||| This does not work, in the disassembly following, the references to
  23. ||| jtab do not refer to the correct address.
  24.         .text
  25. fun:
  26.         bfextu  sp@(20){#0:#4},d0
  27.         movw    pc@(jtab,d0:w:2),d0
  28.         jmp     pc@(jtab,d0:w)
  29.  
  30. jtab:
  31.         .word   badframe-jtab
  32.         .word   threeword-jtab
  33.         .word   fourword-jtab
  34.         .word   fpcp-jtab
  35.         .word   busfault-jtab
  36.         .word   badframe-jtab
  37.  
  38. badframe:
  39.         illegal
  40. threeword:
  41.         rtr
  42. fourword:
  43.         illegal
  44. fpcp:
  45.         illegal
  46. busfault:
  47.         illegal
  48.  
  49. Disassembly of section .text:
  50. 00000000 (jtab-)0016 bfextu sp@(20),0,4,d0
  51. 00000006 (jtab-)0010 movew 0x10[d0.w*2],d0      ||| 0x10 should be 0x16
  52. 0000000e (jtab-)0008 jmp 0x10[d0.w]             ||| 0x10 should be 0x16
  53. 00000016 (jtab+)0000 orb #14,a4
  54. 0000001a (jtab+)0004 orb #18,a0@
  55. 0000001e (jtab+)0008 orb #12,a4@
  56. 00000022 (badframe+)0000 illegal
  57. 00000024 (threeword+)0000 rtr
  58. 00000026 (fourword+)0000 illegal
  59. 00000028 (fpcp+)0000 illegal
  60. 0000002a (busfault+)0000 illegal
  61.  
  62. ||| Noting that the addresses were off by 6 bytes the following 
  63. ||| is an evil workaround
  64.         .text
  65. fun:
  66.         bfextu  sp@(20){#0:#4},d0
  67.         movw    pc@(jtab2,d0:w:2),d0
  68.         jmp     pc@(jtab2,d0:w)
  69.  
  70. jtab:
  71.         .word   badframe-jtab
  72.         .word   threeword-jtab
  73.         .word   fourword-jtab
  74. jtab2:
  75.         .word   fpcp-jtab
  76.         .word   busfault-jtab
  77.         .word   badframe-jtab
  78.  
  79. badframe:
  80.         illegal
  81. threeword:
  82.         rtr
  83. fourword:
  84.         illegal
  85. fpcp:
  86.         illegal
  87. busfault:
  88.         illegal
  89.  
  90.