Simon introduced getVisibility() a while ago but now we need setVisibility() in order to implement visibility for ELF symbols in lld.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
include/llvm/Object/ELFTypes.h | ||
---|---|---|
199 ↗ | (On Diff #21794) | The st_other field might contain other flags except STV_xxx. If one sets such flags and then call setVisibility its overwrites the st_other field completely. Maybe write this function something like this: STV_MASK = 3; void setVisibility(unsigned char v) { assert(v < 4 && "Invalid value for visibility"); st_other = (st_other & ~STV_MASK) | v; } |
Comment Actions
You're right, my bad. I updated the patch. When I was looking at this file I noticed that there's a fair amount of magic hardcoded in there. I left SVT_MASK spelled at 0x3 and I'll plan to audit it entirely and change all the hardcoded values with properly defined constants. Does this make sense to you?