Skip to content
  1. Apr 11, 2012
  2. Apr 10, 2012
  3. Apr 09, 2012
  4. Apr 08, 2012
    • Chandler Carruth's avatar
      Teach LLVM about a PIE option which, when enabled on top of PIC, makes · ede4a8aa
      Chandler Carruth authored
      optimizations which are valid for position independent code being linked
      into a single executable, but not for such code being linked into
      a shared library.
      
      I discussed the design of this with Eric Christopher, and the decision
      was to support an optional bit rather than a completely separate
      relocation model. Fundamentally, this is still PIC relocation, its just
      that certain optimizations are only valid under a PIC relocation model
      when the resulting code won't be in a shared library. The simplest path
      to here is to expose a single bit option in the TargetOptions. If folks
      have different/better designs, I'm all ears. =]
      
      I've included the first optimization based upon this: changing TLS
      models to the *Exec models when PIE is enabled. This is the LLVM
      component of PR12380 and is all of the hard work.
      
      llvm-svn: 154294
      ede4a8aa
  5. Apr 05, 2012
    • Bill Wendling's avatar
      The internalize pass can be dangerous for LTO. · 4f60125d
      Bill Wendling authored
      Consider the following program:
      
      $ cat main.c
      void foo(void) { }
      
      int main(int argc, char *argv[]) {
          foo();
          return 0;
      }
      $ cat bundle.c 
      extern void foo(void);
      
      void bar(void) {
           foo();
      }
      $ clang -o main main.c
      $ clang -o bundle.so bundle.c -bundle -bundle_loader ./main
      $ nm -m bundle.so
      0000000000000f40 (__TEXT,__text) external _bar
                       (undefined) external _foo (from executable)
                       (undefined) external dyld_stub_binder (from libSystem)
      $ clang -o main main.c -O4
      $ clang -o bundle.so bundle.c -bundle -bundle_loader ./main
      Undefined symbols for architecture x86_64:
        "_foo", referenced from:
            _bar in bundle-elQN6d.o
      ld: symbol(s) not found for architecture x86_64
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      
      The linker was told that the 'foo' in 'main' was 'internal' and had no uses, so
      it was dead stripped.
      
      Another situation is something like:
      
      define void @foo() {
        ret void
      }
      
      define void @bar() {
        call asm volatile "call _foo" ...
        ret void
      }
      
      The only use of 'foo' is inside of an inline ASM call. Since we don't look
      inside those for uses of functions, we don't specify this as a "use."
      
      Get around this by not invoking the 'internalize' pass by default. This is an
      admitted hack for LTO correctness.
      <rdar://problem/11185386>
      
      llvm-svn: 154124
      4f60125d
  6. Apr 03, 2012
  7. Apr 02, 2012
  8. Mar 31, 2012
  9. Mar 30, 2012
    • Danil Malyshev's avatar
      Re-factored RuntimeDyLd: · 70d22ccb
      Danil Malyshev authored
      1. The main works will made in the RuntimeDyLdImpl with uses the ObjectFile class. RuntimeDyLdMachO and RuntimeDyLdELF now only parses relocations and resolve it. This is allows to make improvements of the RuntimeDyLd more easily. In addition the support for COFF can be easily added.
      
      2. Added ARM relocations to RuntimeDyLdELF.
      
      3. Added support for stub functions for the ARM, allowing to do a long branch.
      
      4. Added support for external functions that are not loaded from the object files, but can be loaded from external libraries. Now MCJIT can correctly execute the code containing the printf, putc, and etc.
      
      5. The sections emitted instead functions, thanks Jim Grosbach. MemoryManager.startFunctionBody() and MemoryManager.endFunctionBody() have been removed.
      6. MCJITMemoryManager.allocateDataSection() and MCJITMemoryManager. allocateCodeSection() used JMM->allocateSpace() instead of JMM->allocateCodeSection() and JMM->allocateDataSection(), because I got an error: "Cannot allocate an allocated block!" with object file contains more than one code or data sections.
      
      llvm-svn: 153754
      70d22ccb
    • Bill Wendling's avatar
      36cbf03b
    • Bill Wendling's avatar
      Revert r153694. It was causing failures in the buildbots. · 76fdc4b8
      Bill Wendling authored
      llvm-svn: 153701
      76fdc4b8
  10. Mar 29, 2012
  11. Mar 28, 2012
  12. Mar 23, 2012
  13. Mar 22, 2012
    • Chandler Carruth's avatar
      Revert a series of commits to MCJIT to get the build working in CMake · e26dafeb
      Chandler Carruth authored
      (and hopefully on Windows). The bots have been down most of the day
      because of this, and it's not clear to me what all will be required to
      fix it.
      
      The commits started with r153205, then r153207, r153208, and r153221.
      The first commit seems to be the real culprit, but I couldn't revert
      a smaller number of patches.
      
      When resubmitting, r153207 and r153208 should be folded into r153205,
      they were simple build fixes.
      
      llvm-svn: 153241
      e26dafeb
  14. Mar 21, 2012
Loading