bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug report on GNU linker for ARC processor


From: Lucas Lin
Subject: Bug report on GNU linker for ARC processor
Date: Mon, 23 Jul 2001 12:16:28 +0800

Dear maintainers:
 
 
   We've been using GNU compiler to develop software for ARC processor.
   We found the following bug:
 
===================================================================
Subject: bug report on LD for ARC processor
 
The arc-elf-ld produces the wrong immediate address for
"J" instruction. The immediate address of the "J" instruction
is  long word displacement instead of byte displacement.
 
The following code shows that "J" instruction is incorrectly linked:
 
====================================================================
.equ MPEG_GPIO_10, 0xFFEE0015
.global ResetVect
_start:
real_start:
 jal next
next:
 ; Disable Interrupt
 ; flag 0
 ; Light On the LED
 sub.f r1, r1, r1
 sr r1, [MPEG_GPIO_10]
 ; Halt ARC
 flag 1
 nop
 nop
 nop
====================================================================
The aboce code is to be run at 0x00800000, all address are linked against
base address 0x00800000.
 
Here is the output of arc-elf-objdump -D -m arc target.hex:
====================================================================
target.hex:     file format srec
 
No symbols in "target.hex".
Disassembly of section .sec1:
 
00800000 <.sec1>:
  800000: 00 00 1f 38  381f0000 j 8388616
  800004: 08 00 80 00 
  800008: 00 83 20 50  50208300 sub.f r1,r1,r1
  80000c: 00 02 1f 12  121f0200 sr r1,[-1179627]
  800010: 15 00 ee ff 
  800014: 01 80 bf 1f  1fbf8001 flag 1
  800018: ff ff ff 7f  7fffffff nop
  80001c: ff ff ff 7f  7fffffff nop
  800020: ff ff ff 7f  7fffffff nop
====================================================================
 
Here we see that the "jal  next" is translated into :
"00 00 1f 38 08 00 80 00"
 
The immediate address is not "long word" displacement. The correct binary
code should be :
"00 00 1f 38 02 00 20 00"
 
The version of arc-elf-gas & arc-elf-ld are :
 
GNU assembler 2.9.1
Copyright 1997 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
This assembler was configured for a target of `arc-elf'.
 

GNU ld 2.9.1
Copyright 1997 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
  Supported emulations:
   arcelf
 
====================================================================



Lucas Lin  etBIOS, VIA Technologies, Inc.
8F., 533 Chung-Cheng Road,   
Hsin-Tien, Taipei
Taiwan, R.O.C.
(8862) 2218-5452 x 6470
(8862) 2218-9858 fax

address@hidden <mailto:address@hidden> 

 

Attachment: bug.txt
Description: Text document

Attachment: sample.tgz
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]