Bug 27211 - m68k: word branches are not checked for signed overflow
Summary: m68k: word branches are not checked for signed overflow
Status: UNCONFIRMED
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-20 06:47 UTC by Thorsten Otto
Modified: 2021-01-20 06:47 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thorsten Otto 2021-01-20 06:47:26 UTC
When the branch target is known, gas should reject values that overflow the range of a *signed* value. That is, code such as

	.text
	
	braw loopend
	.REPT 20000
	nop
	.ENDR
loopend:

should give an error. Instead, an (incorrect) negative value is written.

Note that ld gives a warning at least, if the target is not known and defined in some other compilation unit (relocation truncated to fit: DISP16 against symbol `loopend')