[PATCH] D33251: [lld][ELF]Add option to make .dynamic read only

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 25 18:20:35 PDT 2017


ruiu added inline comments.


================
Comment at: test/ELF/rodynamic.s:2
+# RUN: llvm-mc %s -o %t.o -filetype=obj -triple=x86_64-pc-linux
+# RUN: ld.lld -shared -z rodynamic %t.o -o %t.so
+# RUN: llvm-readobj -sections %t.so | FileCheck %s
----------------
This doesn't test the feature you've just added, since -shared is passed. You want to remove that flag.


================
Comment at: test/ELF/rodynamic.s:8-13
+# CHECK:      Section {
+# CHECK:        Name: .dynamic
+# CHECK-NEXT:   Type: SHT_DYNAMIC
+# CHECK-NEXT:   Flags [
+# CHECK-NEXT:     SHF_ALLOC
+# CHECK-NEXT:   ]
----------------
This checks the presence of .dynamic section, which is not what you actually want to do.  You want to use `llvm-readobj` like this.

  RUN: ld.lld -o %t1 %t.o
  RUN: llvm-readobj -dynamic-table %t1 | FileCheck -check-prefix=DEFAULT %s
  DEFAULT: DEBUG

  RUN: ld.lld -o %t2 %t.o -z rodynamic
  RUN: llvm-readobj -dynamic-table %t2 | FileCheck %s
  CHECK-NOT: DEBUG


https://reviews.llvm.org/D33251





More information about the llvm-commits mailing list