[PATCH] D36145: [ELF] - Do not segfault when doing logical and/or operations on symbols that have no output sections.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 17 00:29:27 PDT 2017


grimar added inline comments.


================
Comment at: test/ELF/linkerscript/early-assign-symbol.s:10-15
+# RUN: echo "SECTIONS { aaa = foo | 1; .text  : { *(.text*) } }" > %t3.script
+# RUN: not ld.lld -o %t --script %t3.script %t.o 2>&1 | FileCheck %s
+
+# RUN: echo "SECTIONS { aaa = foo & 1; .text  : { *(.text*) } }" > %t4.script
+# RUN: not ld.lld -o %t --script %t4.script %t.o 2>&1 | FileCheck %s
+
----------------
ruiu wrote:
> What is the difference between these two tests? If they are testing the same thing, remove one of them. Unnecessary tests do harm than good. Please do not add tests for "just in case".
First checks `|` and second checks `&` operator.

Them are implemented via `bitAnd()` and `bitOr()` (both use `getValue()` changed in patch atm), 
so I think we want to check both flows ?


https://reviews.llvm.org/D36145





More information about the llvm-commits mailing list