[PATCH] D14586: [elf2] Implement global dynamic tls.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 13 02:46:06 PST 2015


grimar added a subscriber: grimar.

================
Comment at: ELF/OutputSections.cpp:86
@@ -83,2 +85,3 @@
+    Entries.push_back(nullptr);
 }
 
----------------
Probably would be better to make another method for that case because it is still possible for symbol to be TLS but consume only one GOT entry. I fixed this for my patch:
http://reviews.llvm.org/D14621

================
Comment at: ELF/OutputSections.cpp:185
@@ +184,3 @@
+    if (!Rel.C || !Rel.RI)
+      continue;
+
----------------
I would use && here, its more strict check. There should be no other cases when one of these is null but other is not.
More strict way would be to have some static relocation used as allowed stub:


```
static DynamicReloc<ELFT> TlsDynamicRelocationPlaceholder;
...
Out<ELFT>::RelaDyn->addReloc({&C, &RI});
Out<ELFT>::RelaDyn->addReloc(TlsDynamicRelocationPlaceholder);
...
 if (&Rel == &TlsDynamicRelocationPlaceholder)
      continue;
```

================
Comment at: test/elf2/tls-dynamic.s:75
@@ +74,2 @@
+// DIS-NEXT:     1035: {{.+}} callq
+// DIS-NEXT:     103b: {{.+}} leaq    8(%rax), %rcx
----------------
Its not visible here but tabs are used instead of spaces in test in few places. Other tests dont has tabs I think.


http://reviews.llvm.org/D14586





More information about the llvm-commits mailing list