[LLVMdev] Create "appending" section that can be partially dead stripped

Jonas Maebe jonas.maebe at elis.ugent.be
Sat Aug 2 07:51:33 PDT 2014


On 01/08/14 19:37, Reid Kleckner wrote:
> What happens if you drop appending linkage?  I think it will just work,
> since you are already using a custom section, which will ensure that all
> the data appears contiguously in memory.

Thanks for the suggestion, but it still puts everything in a single 
.section statement.

> Although, I do worry about what LLVM's alias analysis will say about
> this... I don't think LLVM allows GEPing from one global to another, and
> at the end of the day, you'll GEP from an external global representing
> the section start through to the elements of the array to section end.

That's true and an interesting point. However, wouldn't that mean that 
"appending" linkage and "section" globals in general are completely 
unusable from llvm IR and would only be safely usable from inline 
assembler or code not compiled by llvm? (unless you don't access such 
data as a contiguous block, but I guess that doesn't happen very often)


Jonas




More information about the llvm-dev mailing list