[PATCH] D25441: [ELF] Make symbols containing ADDR() function synthetic.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 10 12:27:07 PDT 2016


ruiu added a comment.

Currently we are handling "." as an absolute address and convert it to a section-relative values depending on a context. It doesn't fit well to the thing you are trying to implement because we cannot infer whether an assignment should create a section symbol or an absolute symbol. Surely you could add an attribute to an Expr, but it's not clean because an expression is no longer just an expression with that change.

I think the proper way of supporting it is to convert the type of Dot from (uint64_t) to (uint64_t, Section) where Section is a section if it is an section symbol, or a null if it is an absolute symbol. With that change, we can explain the ADDR()'s tricky behavior pretty naturally.


Repository:
  rL LLVM

https://reviews.llvm.org/D25441





More information about the llvm-commits mailing list