lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I found a bug in the EPOC dynamic linker (I think), which makes luaX_error
in llex.c fall over when trying to address token2string. The problem is that
gcc generates a literal data word whose value is token2string-1028. This
address is before the beginning of the module llex.o, and the linker (or
assembler?) turns it into an incorrect address.

The simple fix is to move the definition of token2string to the end of
llex.c. Then token2string-1028 is still within the module, and everything
works.

I've only seen this problem on EPOC, and only when trying to build Lua as a
DLL. One problem with EPOC is that it doesn't allow *writable* static data
in DLLs; it seems that it also has problems with read-only static data under
some circumstances.

The reason I'm writing to the list is partly to share my experience in case
it's useful to anyone else porting Lua to weird OSes, and partly because I
wondered if the above fix might be worth incorporating in the official code
base (as it does not involve any actual code changes, just a change in the
ordering).

But of course I understand if not: this sort of stupid bug isn't the Lua
team's fault at all.

-- 
http://sc3d.org/rrt/ | competent, a.  underpromoted