[PATCH] [Layout] Assign ordinals in resolution order

kledzik at apple.com kledzik at apple.com
Tue Oct 8 22:40:08 PDT 2013


  It looks to me like the ordinals are assigned to archive members as the members are used.  This will result in unstable output because the lazy loading nature of archives loads the members in some what chaotic way (small changes to what if referenced by initial .o files can radically change the load order of members).

  For the darwin linker, we gave each archive a range of ordinals.  For instance if you link with -lfoo -lbar, the library ordinal for libfoo.a might be 100 and for libbar.a be 200.  Later when members are loaded from each, the member's ordinal is the owning libraries ordinal plus the member index (libfoo.a(foo.o) might have an ordinal of 100+3=103).

http://llvm-reviews.chandlerc.com/D1865



More information about the llvm-commits mailing list