[PATCH] D19376: [MC] Create unique .pdata sections for every .text section

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Mon May 2 13:15:29 PDT 2016


> Comment at: include/llvm/MC/MCSectionCOFF.h:36
> @@ +35,3 @@
> +  /// The unique IDs used with the .pdata and .xdata sections created internally
> +  /// by the assembler. This ID is used to ensure that there is a one-to-one
> +  /// mapping from .text section to .pdata and .xdata sections. This data is
> ----------------
> rafael wrote:
>> one-to-many, no?
> For every object-file level .text section, there should be one .pdata section and one .xdata section. Maybe I'll just spell that out.

Yes, please :-)

>> Maybe the name unique id is confusing. It is not really unique, it is really just an disambiguator  when the rest (name, flags) are the same.
>>
> But these two .text sections will have the same unique ID (~0U, the generic section id):
>   .section        .text,"xr",discard,f
>   .section        .text,"xr",associative,f
> And we need a separate .pdata section for each, and they look like:
>   .section        .pdata,"xr",associative,f
>   .section        .pdata,"xr",associative,f
> However, they are created implicitly when assembling the .seh_* directives.
>
> We could assign all sections with the generic ID a non-generic unique ID on creation. We would insert two entries into the uniquing map: one with the generic ID, and one with the specific ID.
>
> At the end of the day, I feel like it's better to just maintain this WinCFI unique ID in the .text section.

I see. I guess you could also store two MCSectionELF pointers, but
since UniqueID is not user visible it is probably fine to use as is.
Please add the above explanation as a comment.

LGTM with that.

Cheers,
Rafael


More information about the llvm-commits mailing list