]> rtime.felk.cvut.cz Git - fpga/lx-cpu1/binutils-tumbl.git/commit
gas: mips: fix segfault with invalid default cpu strings
authorMike Frysinger <vapier@gentoo.org>
Tue, 22 May 2012 01:55:16 +0000 (01:55 +0000)
committerMike Frysinger <vapier@gentoo.org>
Tue, 22 May 2012 01:55:16 +0000 (01:55 +0000)
commit75baece206bad1195fbf3e8cdaaa9e7eaa7aa908
tree639f87861c7de314efafaba9d7613f185a8f4ff9
parent8cb82ab94720875cf1654f1f9c8d084a6dfb9cab
gas: mips: fix segfault with invalid default cpu strings

If you configure gas for a mips32el-* target, the default cpu calculation
gets mangled, and we end up passing and invalid value as the default cpu.

If you try executing gas after that, it segfaults.  This is because it
assumes that the default cpu value is always valid.
$ ./gas/as-new
Assembler messages:
Error: Bad value (2) for default CPU
Segmentation fault (core dumped)

I'm not debating that the target tuple is valid, just that gas shouldn't
crash.  So add a friendly assert to avoid that.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
gas/ChangeLog
gas/config/tc-mips.c