lua-users home
lua-l archive

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


Scott Shumaker wrote:
> -Wl,-E doesn't seem to prevent the linker from stripping them out as
> unused functions, I'm afraid.

Sorry, but that's not what I get:

$ cat >test1.c <<END
int unused(void) { return 42; }
int main(int argc, char **argv) { return 0; }
END
$ cc -O2 -s -Wl,-E -o test1 test1.c
$ nm -D test1 | grep unused
0000000000400730 T unused
$ objdump -d test1 | grep '40073[0-5]'
0000000000400730 <unused>:
  400730:	b8 2a 00 00 00       	mov    $0x2a,%eax
  400735:	c3                   	retq   

--Mike