<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">I have a case where I the expression (MCSymbolRefExpr) is the offset from the beginning of the section.<br>
<br>
The need is to combine that offset to the virtual address of the section it belongs, in this case .text, but it could be any section.<br>
<br>
I can get a MCSectionELF class object from MCSymbol that I get from MCSymbolRefExpr:<br>
<br>
<div style="margin-left: 40px;">  int Kind = Value->getKind();<br>
  if (Kind == MCExpr::SymbolRef) {<br>
    const MCSymbol &Sym = SRE->getSymbol();<br>
    const MCSectionELF = dyn_cast_or_null<MCSectionELF>(Sym.getSection());<br>
  }<br>
</div>
<br>
But can't see how to get the virtual address of the section. This is odd since I would have expected methods for accessing every part of the ELF section header entry.<br>
<br>
How does one get the virtual address (sh_addr in ELF) starting from a MCSymbolRefExpr?<br>
<br>
Thanks,<br>
<br>
Jack<br>
</div>
</body>
</html>