I am looking for an assembler for AVR that could be ran on raspberry. I'd be fine with gnu binutils but avr-ld crashes when I use --oformat binary.

I want assembler because I like assembly. I don't want no IDE/studio because raspberry. I want binary output format because not every time I want to use tools like avrdude that can read hex to write my code/data, it's easier for me in binary. If you know about something please let me know, if not, no probs ;)

The recommended way is to build an .elf, and from that elf generate the needed binaries like .bin, .ihex, etc. using avr-objcopy. Also notice that there are programmers like avrdude that understand .elf so there is no need to convert to binary.

When you use avr-as, you'll get link-able object code. This can be linked+located using ld.

Also notice that it's way easier to use the avr-gcc driver program to assemble and link your code. For example, to get main.elf from your .S file is as easy as

avr-gcc -mmcu=atmega8 main.S -o main.elf

This will 1) call the C preprocessor on your asm input, 2) assemble the result to an object file, 3) adds library code as needed, start-up code and vector-table for ATmega8 and 4) links+locates the result to produce main.elf.

> avr-as generates relocation for references to all labels, so I cant use objcopy I would just get bogus code.

Yes, of course. The assembler does NOT generate executable code but object files (with "placeholders" so that the code can be combined with other modules to compose complex projects or even combine assembly with C / C++ or pre-built library code).