[llvm] [llvm-readobj][AArch64][ELF][PAC] Support ELF AUTH constants (PR #72713)

Daniil Kovalev via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 7 09:23:43 PST 2023


================
@@ -6208,6 +6263,13 @@ void ELFDumper<ELFT>::forEachRelocationDo(
       Warn(RangeOrErr.takeError());
     }
     break;
+  case ELF::SHT_AARCH64_AUTH_RELR:
+    if (Obj.getHeader().e_machine != EM_AARCH64) {
+      this->reportUniqueWarning(
----------------
kovdan01 wrote:

It turns out that we can't assume that only relocation sections are passed to `forEachRelocationDo` - there are code paths when other section types also get there, for example, `printSectionHeaders -> printRelocationsHelper -> forEachRelocationDo`. So, we must break here on non-AArch64 emachine (the switch does not contain a default branch, so break looks OK for me).

I also added checks against emachine in other places where appropriate and moved code/tests to target-specific parts where needed. @MaskRay Please see f9103d548b61a60f41e7529ea357b6ee2b8a0f66 and let me know if it is OK.


https://github.com/llvm/llvm-project/pull/72713


More information about the llvm-commits mailing list