News for hackers. Stuff that matters.
Re:AT&T Syntax versus Intel Syntax by chrisseaton on Sunday November 13, 2022 @03:08PM (#33586793)
Isn't this a function of the tools you were using, not the syntax? Couldn't any of these tools support any syntax and do the same thing?
Re:AT&T Syntax versus Intel Syntax by JonChesterfield on Sunday November 13, 2022 @04:02PM (#33587313)
The line between syntax and functionality is pretty thin for an assembler.

I've definitely had code that some assemblers accepted and others didn't on the same arch, so even if they could be equally expressive in practice they aren't. Fairly sure that's also true of inline assembly on clang x64, had to change between intel and at&t for something a while ago.

Re:AT&T Syntax versus Intel Syntax by throwawaylinux on Sunday November 13, 2022 @06:08PM (#33588342)
Not really. Intel vs AT&T syntax is about how to generate machine code from mnemonics.

Cooperation with the linker comes with other directives and options. gas has tight cooperation with GNU ld via directives, not instruction syntax. It can actually be set to accept either AT&T or Intel syntax, without losing any support for other features.

Re:AT&T Syntax versus Intel Syntax by JonChesterfield on Monday November 14, 2022 @04:44AM (#33591891)
The case that comes to mind was emitting a (correct) relocation for one mode and raising an error for the other. That was more likely to be llvm-mc than gas though, so results from on assembler may not apply to all assemblers.
Re:AT&T Syntax versus Intel Syntax by throwawaylinux on Monday November 14, 2022 @06:08AM (#33592480)
Emitting a relocation with .reloc directive? Definitely sounds like an llvm-as bug.
Re:AT&T Syntax versus Intel Syntax by JonChesterfield on Monday November 14, 2022 @08:12AM (#33593444)
No, it was an arithmetic expression related to labels. And yes I'd agree that it working in... I want to say intel and not at&t (might be the other way around) is a bug/missing feature. Didn't bother fixing or reporting it at the time though.