[PATCH] D97117: [XCOFF] add C_FILE symbol at index 0
Hubert Tong via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 20 08:38:21 PST 2021
hubert.reinterpretcast added inline comments.
================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:806
+ // FIXME: support 64-bit C_FILE symbol.
+ writeSymbolName(".file");
+ W.write<uint32_t>(0);
----------------
The symbol name is `.file` when the auxiliary entry is present and is the source filename when not. Ideally, we put in the intended value; otherwise, this needs to be marked with a FIXME.
================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:806
+ // FIXME: support 64-bit C_FILE symbol.
+ writeSymbolName(".file");
+ W.write<uint32_t>(0);
----------------
hubert.reinterpretcast wrote:
> The symbol name is `.file` when the auxiliary entry is present and is the source filename when not. Ideally, we put in the intended value; otherwise, this needs to be marked with a FIXME.
Please add comments indicating the field being written in a manner consistent with `writeSymbolTableEntryForControlSection`.
================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:807
+ writeSymbolName(".file");
+ W.write<uint32_t>(0);
+ W.write<int16_t>(XCOFF::ReservedSectionNum::N_DEBUG);
----------------
Add comment: The "symbol value" of a C_FILE symbol is its symbol table index.
================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:809
+ W.write<int16_t>(XCOFF::ReservedSectionNum::N_DEBUG);
+ W.write<uint16_t>(0);
+ W.write<uint8_t>(XCOFF::C_FILE);
----------------
Add comment: The n_type field of a C_FILE symbol encodes the source language and CPU version info; zero indicates no info.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97117/new/
https://reviews.llvm.org/D97117
More information about the llvm-commits
mailing list