OSX 10.5 Leopard Symbol Mangling with $ non_lazy_ptr

Why does Leopard cripple some characters with $ non_lazy_ptr? More importantly, what is the best way to fix undefined character errors because the character was distorted with $ non_lazy_ptr?

+3
source share
5 answers

From: Connecting to a developer - indirect addressing

Indirect addressing is the name of a code generation method that allows you to refer to characters defined in one file from another file without requiring the referenced file to have explicit knowledge of the layout of the file that defines the character. Therefore, the defining file can be modified independently of the link file. Indirect addressing minimizes the number of places that must be changed by the dynamic linker, which facilitates code sharing and improves performance.

When a file uses the data defined in another file, it creates links to characters. A symbol reference identifies the file from which the symbol is imported and the reference symbol. There are two types of character references: nonlazy and lazy.

( ) . - , , - . .

( ). . , , . , , .

+5

: $non_lazy_ptr, . , , Foo, _Foo $non_lazy_ptr, - undefined, - - . , /, . , , , , , . Google .

+3
ranlib -c libwhatever.a

. PJSIP iOS. autoconf make, , iOS. runlib , _PJ_NO_MEMORY_EXCEPTION, _PJ_NO_MEMORY_EXCEPTION$non_lazy_ptr undefined.

Adding the ranlib line back to the library file resolved it. Now my full entry for LIBS in rules.mak

$(LIB): $(OBJDIRS) $(OBJS) $($(APP)_EXTRA_DEP)
    if test ! -d $(LIBDIR); then $(subst @@,$(subst /,$(HOST_PSEP),$(LIBDIR)),$(HOST_MKDIR)); fi
    $(LIBTOOL) -o $(LIB) $(OBJS)
    $(RANLIB) -c $(LIB)

We hope this helps others and also tries to use common UNIX-configured external libraries with iPhone or iOS.

+2
source

If someone else is facing the same problem, I had:

Had extern NSString* const someString;a header file, but forgot to put it in the implementation file. asNSString* const someString=@"someString";

This resolved it.

+1
source

ranlib -c in the library file fixes the problem

0
source

Source: https://habr.com/ru/post/1697012/


All Articles