home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / atari / st / tech / 5511 < prev    next >
Encoding:
Text File  |  1992-11-07  |  2.5 KB  |  74 lines

  1. Newsgroups: comp.sys.atari.st.tech
  2. Path: sparky!uunet!spool.mu.edu!sol.ctr.columbia.edu!star!richard
  3. From: richard@op.ph.ic.ac.uk (Richard Syratt )
  4. Subject:  Re: Cross Compiling Sozobon 2.0
  5. Keywords: hash function
  6. References: <1992Nov2.133525.7992@sol.ctr.columbia.edu> <1992Nov3.140438.19093@news.lrz-muenchen.de> <567@muller.loria.fr>
  7. Sender: richard@star (Richard Syratt )
  8. Organization: Imperial College, London University
  9. Date: Fri, 6 Nov 1992 10:14:57 GMT
  10. Message-ID: <1992Nov6.101457.26761@sol.ctr.columbia.edu>
  11. X-Posted-From: op.ph.ic.ac.uk
  12. NNTP-Posting-Host: sol.ctr.columbia.edu
  13. Lines: 59
  14.  
  15. In article <567@muller.loria.fr>, eker@loria.crin.fr (Steven Eker) writes:
  16. |> In article <1992Nov3.140438.19093@news.lrz-muenchen.de>, HUSFELD@usmv01.usm.uni-muenchen.de (Husfeld, Dirk) writes:
  17. |> |> In <1992Nov2.133525.7992@sol.ctr.columbia.edu> richard@op.ph.ic.ac.uk writes:
  18. |> 
  19. |> [discussion of what hashing is supposed to be deleted]
  20. |> |> > I've spotted that this [deleted] routine only uses the 1st to fifth
  21. |> |> > letters of the name ...
  22. |> 
  23. |> Actually 1st -> 4th letters.
  24. Well if you really want to be fussy it's 2nd letter -> 5th letter :-}
  25. |>  
  26. |> |> > ... in fact the routine only seems to return hash values
  27. |> |> > of 46,61,62,63 whatever is passed through to it when it u
  28. |> 
  29. |> This is a truly _awful_ hash function; simply ORing and shifting is
  30. |> going to produce a heavy bias towards hash values with lots of ones -
  31. |> especially in the more significant bits:
  32. |> 46=%101110, 61=%111101, 62=%111110, 63=%111111
  33. |> (one can guess that NHASH=64)
  34. |> 
  35. |> Replace the OR (|) with addition (+) or exclusive-OR (^) for some improvement.
  36. |> 
  37.  
  38. OK I agree the hash function needs changing, but... I've decided it's not
  39. the problem ... but I'll change it anyway.  After a while running ld through
  40. a source level debugger to try and work out what it's doing I've discovered
  41. what's going on and managed to recreate the problem... half way there now at
  42. least.
  43.  
  44. ld will not pick up *any* externally defined uninitialised variable from a
  45. library!  Would some one like to check if hsc fails with this?
  46.  
  47. e.g.
  48. test.c:
  49.     int    test_var;
  50.  
  51. cc -c test.c
  52. ar r test.a test.o
  53.  
  54. test2.c:
  55.     extern int test_var;
  56.     main()
  57.     {
  58.         test_var=3;
  59.     }
  60.  
  61. cc test2.c test.o works
  62. cc test2.c test.a doesn't!!!  (undefined symbol _test_var from test2.o)
  63.  
  64. nm reckons they contain the same info - so I'm now checking
  65. out the differences between how ld handles an object file and a library.
  66.  
  67. [stuff deleted]
  68.  
  69. |> Steven
  70.  
  71. Richard
  72.  
  73. BTW anyone know if sozobon can be emailed, and if so where?
  74.