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

Daniil Kovalev via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 4 02:14:35 PST 2023


================
@@ -2086,21 +2086,34 @@ template <typename ELFT> void ELFDumper<ELFT>::parseDynamicTable() {
       break;
     case ELF::DT_RELR:
     case ELF::DT_ANDROID_RELR:
+    case ELF::DT_AARCH64_AUTH_RELR:
       DynRelrRegion.Addr = toMappedAddr(Dyn.getTag(), Dyn.getPtr());
       break;
     case ELF::DT_RELRSZ:
     case ELF::DT_ANDROID_RELRSZ:
+    case ELF::DT_AARCH64_AUTH_RELRSZ:
       DynRelrRegion.Size = Dyn.getVal();
-      DynRelrRegion.SizePrintName = Dyn.d_tag == ELF::DT_RELRSZ
-                                        ? "DT_RELRSZ value"
-                                        : "DT_ANDROID_RELRSZ value";
+      if (Dyn.d_tag == ELF::DT_RELRSZ)
----------------
kovdan01 wrote:

In general, I agree that `switch` is better for choosing between enum values. However, we'll  only have a single line in each `case`, and for each of them we'll also have a `break`. To avoid that, we might use immediately invoked function expression, but `if else if` was previously considered a better alternative in a discussion with @MaskRay here https://reviews.llvm.org/D156882?id=554796#inline-1548995.

If `switch` with additional `break`'s still looks better than `if else if` - please re-open the thread and let me know, I'll change that.



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


More information about the llvm-commits mailing list