The R_AARCH64_TLSLE_ADD_TPREL_LO12_NC relocation also only uses the low page bits, but is missing from the usesOnlyLowPageBits function. At present the usesOnlyLowPageBits function is not called for this relocation but I think it is worth adding for the completeness of usesOnlyLowPageBits.
Details
Diff Detail
Event Timeline
I would try to avoid dead code. So until it is possible to add a test case for this change, I would not do that probably.
Perhaps it is worth a comment instead as the function name implies a complete list. For example "// not a complete list, excludes relocations that can always be resolved statically such as TLS local exec."
I think the ones that are already there can be used as they are one of R_GOT, R_PLT, R_TLSDESC, or (!AbsVal && !RelE) can be true. The local exec relocations are always AbsVal = true and all have a RelExpr of R_TLS.
I'm not hugely fussed either way, I was just unsure of whether to add new LO12_NC relocations to that function or not.
Ok. So, personally my opinion - I would not add any code that is unproven to be useful. This applies to this patch.
Ok I'll abandon this one and I'll update D46255 to remove the new TLSLE relocations I added to usesOnlyLowPageBits as the same argument applies.