Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Please place this in one of the x86-64-tls-ld*.s files. For ppc64 we use ppc64-dtprel.s
lld/test/ELF/relocation-dyn-tls-debug-info.s | ||
---|---|---|
31 ↗ | (On Diff #378269) | Two values should be sufficient. You can use .quad 0 or .space to add a gap if you think 0 as a value is too special. |
lld/test/ELF/relocation-dyn-tls-debug-info.s | ||
---|---|---|
10 ↗ | (On Diff #378269) | Drop --gc-sections from this test. It doesn't do anything special. The property is tested in debug-dead-reloc* files. |
This test is testing the patching behaviour of DTPREL in non-alloc sections, specifically .debug_info because that's the usual use case, so I'm not sure it really fits with the x86-64-tls-ld*.s tests. Do you want me to rename this test to x86-64-dtprel.s or do you have another suggestion?
lld/test/ELF/relocation-dyn-tls-debug-info.s | ||
---|---|---|
10 ↗ | (On Diff #378269) | The focus of this testing is the following code from InputSection::relocateNonAlloc in InputSection.cpp: if (tombstone || (isDebug && (type == target->symbolicRel || expr == R_DTPREL))) { This is why I added --gc-sections because although the actual behaviour now is not special there is this specific code path. However, thanks for spotting debug-dead-reloc-tls.s which already provides coverage. Not sure how I managed to miss this in my search for existing coverage. I will remove this --gc-sections test case. |
31 ↗ | (On Diff #378269) | Yes, two values are sufficient, the third value was really for the --gc-sections test case which is no longer required. |
DTPREL relocations are used in the local-dynamic TLS model. The non-alloc section context is slightly different, but I think just reusing one file is fine (in this case I think fewer tests are easier to organize).