[PATCH] D47098: [ELF] Support R_X86_64_GOTPC{32,64}

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 1 10:25:06 PDT 2018


MaskRay added a comment.

This revision is independent from https://reviews.llvm.org/D47507 though only with both we can make the following assembly sequence work no matter the value of _GLOBAL_OFFSET_TABLE_:

  // -mcmodel=medium
  // extern long _DYNAMIC[] __attribute__((visibility("hidden")));
  // long* foo() {
  //   return _DYNAMIC;
  // }
  
  	leaq	_GLOBAL_OFFSET_TABLE_(%rip), %rdx
  	movabsq	$_DYNAMIC at GOTOFF, %rax

Does this cleaned-up revision look good? (The changes to relocation calculation have been removed)


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D47098





More information about the llvm-commits mailing list