[PATCH] [lld][ELF] rename TLV contentTypes for ELF

kledzik at apple.com kledzik at apple.com
Thu Aug 22 19:23:33 PDT 2013


  FYI, on darwin the __thread model is that all thread variables are accessed by calling through a thunk.  On disk, the thunk contains size info and a pointer to any initialization data.  At runtime, the thunk is changed by the loader to contain a pointer to a function that returns the address of the variable for the current thread along with data (phread key and offset) to allow the function to work.

  So a thread local variable definition (e.g.  __thread int foo = 5;) triggers the compiler to generate:
  1) a symbol "foo" with a size of a thunk in special section that gives it a content type typeThunkTLV.
  2) a local symbol "Lfoo$init" of size 4 with content of 5 in a section that gives it content typeTLVInitialiData.

  The difference with ELF is that in darwin the name the user gave the __thread variable is on the thunk and not on the initial data.

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



More information about the llvm-commits mailing list