jasonliu added inline comments.

================
Comment at: llvm/lib/MC/MCObjectFileInfo.cpp:889
+  CompactUnwindSection =
+      Ctx->getXCOFFSection(".eh_info_table", 
XCOFF::StorageMappingClass::XMC_RW,
+                           XCOFF::XTY_SD, SectionKind::getData());
----------------
daltenty wrote:
> jasonliu wrote:
> > daltenty wrote:
> > > I think this may have been discussed elsewhere, but why do we want to 
> > > emit this as a RW section?
> > Yes, this has been discussed before. And it's a good question.
> > If we emit this as an RO section, then we could not put 
> > ```
> > .vbyte      4, GCC_except_table1
> > .vbyte      4, __xlcxx_personality_v1[DS]
> > ```
> > into this csect directly. 
> > If we do that, we would hit linker error during link time. It seems that 
> > for read only csects (RO, PR mapping classes), we could not have relocation 
> > types like `R_POS` or `R_NEG` because the result coming out of it is not 
> > link-time constant. And the relocation types in read only csects needs to 
> > be link time constant.
> > 
> > Extra work (both compiler and runtime) will be needed if we want to make 
> > this RO.
> Thanks for clarifying. I guess we'd presumably need to add the TOC 
> indirections to get to the LSDA and personality routine's function 
> descriptor,  similar  to elsewhere. 
> 
> Since this structure is version'd, seems like we have the flexibility to 
> defer that work, so I guess that's OK.
> add the TOC indirections to get to the LSDA and personality routine's 
> function descriptor
Yep, that's one potential way to solve it. The downside of it would be 
1. We might have more TC entries than we desired.
2. A small performance penalty to pay for the extra indirection. (But since we 
already on the EH path, and it's slow anyway, might not be that big of a deal).
But as you already mentioned, we don't have to solve this issue right now. 


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

https://reviews.llvm.org/D91455

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to