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