[PATCH] D36499: If --dynamic-list is given, only those symbols are preemptible

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 8 22:42:58 PDT 2017


smeenai added a comment.

Thank you!

One issue I have is that this still conflates version scripts and dynamic lists, whereas they're orthogonal concepts in my mind; a version script controls dynamic symbol table population, while a dynamic list (for a shared library) controls preemptibility. The test case  below demonstrates this; it passes with ld.bfd and ld.gold.

  # REQUIRES: x86
  
  # RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
  # RUN: echo "{ foo; };" > %t.list
  # RUN: echo "{ global: foo; bar; };" > %t.vers
  # RUN: ld.lld -fatal-warnings -dynamic-list %t.list -version-script %t.vers -shared %t.o -o %t.so
  # RUN: llvm-readobj -r %t.so | FileCheck --check-prefix=RELOCS %s
  # RUN: llvm-nm -DU %t.so | FileCheck --check-prefix=DYNSYMS %s
  
  # RELOCS:      Relocations [
  # RELOCS-NEXT:   Section ({{.*}}) .rela.plt {
  # RELOCS-NEXT:     R_X86_64_JUMP_SLOT foo 0x0
  # RELOCS-NEXT:   }
  # RELOCS-NEXT: ]
  
  # DYNSYMS:      bar
  # DYNSYMS-NEXT: foo
  
  	.globl	foo
  foo:
  	ret
  
  	.globl	bar
  bar:
  	ret
  
  	call	foo at PLT
  	call	bar at PLT


https://reviews.llvm.org/D36499





More information about the llvm-commits mailing list