[PATCH] D91670: Fix crash after looking up dwo_id=0 in CU index.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 17 21:23:07 PST 2020


MaskRay added inline comments.


================
Comment at: llvm/test/tools/llvm-symbolizer/split-dwarf-zero-signature-not-found.s:93
+        .section        .debug_cu_index,"", at progbits
+        .short  2                       # DWARF version number
+        .short  0                       # Reserved
----------------
For version 2, the field should be `.long 2`

(The difference matters if this is big-endian)


================
Comment at: llvm/test/tools/llvm-symbolizer/split-dwarf-zero-signature-not-found.s:3
+
+# RUN: llvm-mc --filetype=obj --triple x86_64-pc-linux %s -o %t --defsym MAIN=0
+# RUN: llvm-mc --filetype=obj --triple x86_64-pc-linux %s -o %t.dwp --defsym DWP=0
----------------
Since MAIN and DWP are mutual exclusive, you can just define one macro and use

```
.ifdef
...
.else
...
.endif
```

I usually write `x86_64-pc-linux` as `x86_64` to represent that this is a generic ELF behavior, rather than a Linux specific one.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91670/new/

https://reviews.llvm.org/D91670



More information about the llvm-commits mailing list