[PATCH] D66969: Output XCOFF object text section header and symbol entry for program code

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 11 10:15:14 PDT 2019


hubert.reinterpretcast accepted this revision.
hubert.reinterpretcast added a comment.
This revision is now accepted and ready to land.

LGTM with minor changes that can be made on the check-in.



================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:360
+  writeSymbolName(SymbolRef.getName());
+  assert(CSectionRef.Address + SymbolOffset <= UINT32_MAX &&
+         "Symbol address overflows.");
----------------
This would not be sufficient to avoid overflow if `SymbolOffset` is less than `UINT32_MAX` away from `UINT64_MAX`, use: `SymbolOffset <= UINT32_MAX - CSectionRef.Address`.



================
Comment at: llvm/test/CodeGen/PowerPC/aix-xcoff-common.ll:83
 ; SYMS-NEXT: Symbols [
-; SYMS-NEXT:   Symbol {
-; SYMS-NEXT:     Index: [[#Index:]]
-; SYMS-NEXT:     Name: a
+; SYMS:        Symbol {{{[[:space:]] *}}Index: [[#Index:]]{{[[:space:]] *}}Name: a
 ; SYMS-NEXT:     Value (RelocatableAddress): 0x0
----------------
Please use `{{[{]` instead of `{{{` to avoid ambiguity as to where the regular expression starts and, if the regular expression starts with the first `{{`, to avoid the undefined results indicated by POSIX regarding `{` as the first character of an ERE.


================
Comment at: llvm/test/CodeGen/PowerPC/aix-xcoff-lcomm.ll:54
 ; SYMS-NEXT: Symbols [
-; SYMS-NEXT:   Symbol {
-; SYMS-NEXT:     Index: [[#Index:]]
-; SYMS-NEXT:     Name: a
+; SYMS:        Symbol {{{[[:space:]] *}}Index: [[#Index:]]{{[[:space:]] *}}Name: a
 ; SYMS-NEXT:     Value (RelocatableAddress): 0x0
----------------
Same comment.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D66969





More information about the llvm-commits mailing list