lua-users home
lua-l archive

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


> A bunch of symbols got stripped out (such as all of the _lj_BC_*
> symbols and some _lj_vm_* symbols) with a handful of nop's appearing
> where the symbols and their associated code should have been.
>
> It looks like the dead code detector on Mac just kinda chokes when you
> put a symbol in the middle of a function; it strips out everything
> until the next unconditional jump. I mean, it's pretty obvious what
> you were trying to do in the code there; it makes perfect sense to do
> it this way when you're writing assembly code.
>
> Part of me thinks that the "easy" solution would be to put some
> artificial references to the mistakenly-stripped symbols somewhere,
> but this is where my experience starts to peter out; I know how to do
> this with C functions but not with stuff defined in assembly. Ideally
> I could just have some sort of definitions file that tells the linker
> "these are important, don't strip them no matter what" but I don't
> know how to do that. (I'm open for advice!)

Well, the good news is that I've got a build that works now.

The bad news is that this isn't something I'd be happy submitting as a
patch, because it's ugly as sin.

I've defined all of the symbols that were getting dead-stripped as C
functions and then added a function that takes the address of each of
those functions. It's the only way I know how to force the issue; I
can't help but feel that there's got to be a better way to do it, but
the -non_global_symbols_no_strip_list directive didn't work.

I'm getting back to work now, but I'd like to be able to contribute
something that will help avoid this kind of problems for other
developers in the future.

/s/ Adam