[llvm-commits] ARM ELF disassembly with integrated-as

Jim Grosbach grosbach at apple.com
Thu Nov 29 13:04:50 PST 2012


On Nov 29, 2012, at 12:49 PM, Tim Northover <t.p.northover at gmail.com> wrote:

>> I was under the impression that for ELF, the assembler source code
>> would have explicit $a, $t and $d labels that specify the regions. That's
>> not the case?
> 
> Afraid not. The two examples I have are GCC and armcc. Both of those
> have assemblers which infer the symbols. Neither GAS nor armasm have
> explicit region delimiters.

Ugh. That's horrible. I'm pretty strongly philosophically opposed to that approach. Assemblers should not be smart about things like this. They should do what they're told. The real world isn't quite that simple, of course.

We also very much want to have compatibility with GAS when at all reasonable. In this particular case, my specific technical concern is a whole mess of changes all over the place in the assembler. If you can do it entirely in the ELF streamer instead , those concerns are significantly lessened, FWIW. It'll still be a whole lots of things to change and a fair bit of fragility, but it'll be contained to the target that actually cares about the functionality (ARM+ELF). You're right that such a system would be mostly (entirely?) orthogonal to the data-region system MachO uses. You could, if you chose, support both, but I don't know if there's much value to that.

Short version: If it's possible to keep the logic inside the ELF-specific stuff, probably the streamer, then I can hold my nose on the philosophical questions.


-Jim


> 
>> That's an excellent example of why I don't like the assembler trying to
>> be smart about this stuff. It can't ever tell the difference between a .long
>> in the code stream that's a manually encoded instruction and a .long that's
>> a data payload.
> 
> It's not immediately clear to me that explicitly delineated regions
> are better than some kind of ".dci" directive for when you *do* want
> to insert a hard-coded instruction. I suppose it is more orthogonal,
> but I'm sure there's enough paint here for a whole fleet of bikesheds.
> 
> Tim.




More information about the llvm-commits mailing list