[llvm-branch-commits] [llvm] [GOFF] Add writing of section symbols (PR #133799)
Kai Nacke via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Apr 8 10:53:34 PDT 2025
redstar wrote:
> > I use the ordinal number +1 of the section as the section number, but still need a counter for the symbols.
>
> Can't we just set the ordinal to the correct value to begin with? ELF sets the ordinals while writing out the sections; I think we might as well do the same. (The point being that if we have already ensured we write sections in the correct order, then we will only ever need to refer to ordinals of sections that have already been written.) Then we'd be back to a single counter used by the writer for all GOFF symbol records, those that come from sections as well as those that come from symbols.
At first I was a bit confused about this, because the `MCAssembler` sets the ordinal. Well, it seems that the ELF writer overwrites those values. :-) Sure, I can do the same.
https://github.com/llvm/llvm-project/pull/133799
More information about the llvm-branch-commits
mailing list