Ro5bert / avra

Assembler for the Atmel AVR microcontroller family
GNU General Public License v2.0
156 stars 40 forks source link

Avra 1.4.0 does not generate error for RAM overlap #14

Closed Nevada317 closed 4 years ago

Nevada317 commented 4 years ago

While compiling test case code, no error arise in 1.4.0, while segment overlap occur in .DSEG.

Test case $ cat main.asm

.include "m162def.inc"
.dseg
.org 0x0100
.BYTE 1000
.org 0x0300
.BYTE 10

.cseg
.org 0
nop
rjmp (PC-1)

.BYTE 1000 here overlaps with next segment, as it ends at 0x04E7, while another segment starts at 0x0300.

avra 1.3.0 Everything OK, error detected:

Pass 1... Error: Overlapping Data-segments : Start = 0x0100, End = 0x04E7, Length = 0x03E8 Start = 0x0300, End = 0x0309, Length = 0x000A Please check your .ORG directives !

avra 1.4.0 Error not detected:

Pass 1... Pass 2... done

Assembly complete with no errors. Segment usage: Code : 2 words (4 bytes) Data : 1010 bytes EEPROM : 0 bytes

I've tried also to use -O e and .nooverlap with no luck for RAM. Looks like RAM is ignored here. I use .ORG directives pretty frequently to align buffers to 256-byte boundaries, so this overlap test is important for me.

Is there any way anybody can fix this? I'll try to bisect, but currently my workload is high enough, so it will take a long time.

Nevada317 commented 4 years ago

Looks like bug introduced in: 3e0d391ab7570036ddaeb38f6fe87ac718d9ffac

Commit 97297fec4f560783957bf8cadfa8337718aaa1f5 - everything is fine

Nevada317 commented 4 years ago

Pull request created: https://github.com/Ro5bert/avra/pull/15