Bug 6043 - sh64: Assertion failure in shmedia_md_pcrel_from_section
Summary: sh64: Assertion failure in shmedia_md_pcrel_from_section
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: 2.19
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-06 18:13 UTC by Adrian Bunk
Modified: 2008-04-07 04:26 UTC (History)
1 user (show)

See Also:
Host:
Target: sh64-unknown-linux-gnu
Build:
Last reconfirmed:


Attachments
libgcc2.s (1.20 KB, text/plain)
2008-04-06 18:14 UTC, Adrian Bunk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Bunk 2008-04-06 18:13:08 UTC
$ sh64-linux-as libgcc2.s 
libgcc2.s: Assembler messages:
libgcc2.s:410: Internal error!
Assertion failure in shmedia_md_pcrel_from_section at
/TMP/binutils-2.18.50.0.6/gas/config/tc-sh64.c line 3067.
Please report this bug.
$ sh64-linux-as --version
GNU assembler (Linux/GNU Binutils) 2.18.50.0.6.20080403
Copyright 2007 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `sh64-linux'.
$
Comment 1 Adrian Bunk 2008-04-06 18:14:06 UTC
Created attachment 2359 [details]
libgcc2.s
Comment 2 Kaz Kojima 2008-04-06 23:38:32 UTC
A reduced testcase:

	.text
.LFB1:
	.section	.eh_frame,"a",@progbits
.LASFDE1:
	.uaquad	.LFB1-.

It seems that the recent gas calls shmedia_md_pcrel_from_section with the way
that the function didn't expect.  I'm testing the following patch now.

diff -uprN ORIG/src/gas/config/tc-sh64.c LOCAL/src/gas/config/tc-sh64.c
--- ORIG/src/gas/config/tc-sh64.c	2007-07-31 09:12:54.000000000 +0900
+++ LOCAL/src/gas/config/tc-sh64.c	2008-04-07 07:30:33.000000000 +0900
@@ -3064,8 +3064,7 @@ shmedia_md_pcrel_from_section (struct fi
 
     case BFD_RELOC_64:
     case BFD_RELOC_64_PCREL:
-      know (0 /* Shouldn't get here.  */);
-      break;
+      /* Fall through.  */
 
     default:
       /* If section was SHcompact, use its function.  */
Comment 3 Kaz Kojima 2008-04-07 04:26:49 UTC
Fixed.