[PATCH] D66969: Output XCOFF object text section
Sean Fertile via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 6 13:07:05 PDT 2019
sfertile added inline comments.
================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:92
uint16_t Index;
----------------
jasonliu wrote:
> Should this also be int16_t? Since the Index could be negative value it seems.
I'll try to answer since I originally committed this wrapper class. I don't //think// we need t be able to represent actual sections with a negative index. For 'real' sections I believe the index will be a number always greater than or equal to 1. The other sections indexes are:
0: This will be the section index on symbol table entries for references to symbols defined externally and we don't know what section its in.
-1: This will be the section index on symbol table entries of absolute symbols. So not in a section.
-2: Some debug symbols will have this section index. In this case I'm not sure if its similar to absolute symbols, as in the debug symbols are not contained in a section, or if this is some special debug section that must be created, in which case this filed will have to change type.
It doesn't hurt to change the field to a signed type anyway. Although I suggest we do it in a separate patch, that also adds overflow checking to when we assign the section indexes.
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