public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* interworking problem
@ 2005-02-22 12:56 aram bharathi
  2005-02-22 14:45 ` Nick Clifton
  0 siblings, 1 reply; 2+ messages in thread
From: aram bharathi @ 2005-02-22 12:56 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc, binutils

hi,
   thanks for identifying the error.
   i have gone through the a.out file after this error. that is producing full of arm instructions other than the main function(which is compiled for -mthumb). where should i change for this corresponding error. 
   i have added one new add instruction in thumb mode. based on that i have written one sample program to emit the corresponding new instruction. gcc works fine. when i assemble the function it emits correct opcode. but when i give the same function to the ld it emits full of arm instructions instead of thumb instructions. which routine checks for this corresponding change. 
thanks in advance  
----- Original Message -----
From: "Ian Lance Taylor" <ian@airs.com>
To: "aram bharathi" <arambharathi@linuxmail.org>
Subject: Re: adding new instruction
Date: 12 Feb 2005 21:06:07 -0500

> 
> "aram bharathi" <arambharathi@linuxmail.org> writes:
> 
> >   i like to add a new instruction based on thumb ISA. i have 
> > added the instruction in both as and gcc. both of them are 
> > working correctly. but when i call ld it shows an error like
> >
> > /home/.../arm-elf-ld : 
> > /home/../arm-elf/lib/libc.a(printf.o)(printf): warning : 
> > interworking not enabled
> > first occurance : /tmp/cc00zhyh.o : thumb call to arm
> > /tmp//cc00zhyh.o(.text+0x4e>: In function 'main'
> > new.c:internal error: dangerous error
> >
> > whether i have to change anything in the ld. i have searched for 
> > the ld source file but i counldnt get one in the ld folder. which 
> > file has to modified first and what kind of changes are needed.
> 
> The source code for that error is in the bfd directory.  In general,
> if you want to link ARM and Thumb code together, you should compile
> all your code with the -mthumb-interwork option.  See the
> documentation.
> 
> Ian

-- 
______________________________________________
Check out the latest SMS services @ http://www.linuxmail.org 
This allows you to send and receive SMS through your mailbox.


Powered by Outblaze

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: interworking problem
  2005-02-22 12:56 interworking problem aram bharathi
@ 2005-02-22 14:45 ` Nick Clifton
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Clifton @ 2005-02-22 14:45 UTC (permalink / raw)
  To: aram bharathi; +Cc: Ian Lance Taylor, gcc, binutils

Hi Aram,

>    i have gone through the a.out file after this error. 
 > that is producing full of arm instructions other than the main
> function(which is compiled for -mthumb). 
> where should i change for this corresponding error. 

It is not clear what question you are asking here.

Ian has pointed out that you should be compiling your program with the 
-mthumb-interwork switch specified on the gcc command line.

>    i have added one new add instruction in thumb mode. based on that
> i have written one sample program to emit the corresponding new 
> instruction. gcc works fine. when i assemble the function it emits 
 > correct opcode. but when i give the same function to the ld it
 > emits full of arm instructions instead of thumb instructions.
 > which routine checks for this corresponding change.

Again this is not clear.  Do you mean that when the linker is creating 
the executable that it is inserting some ARM-encoded instructions into 
the output, or that it is somehow magically transforming your 
THUMB-encoded instructions into ARM-encoded instructions ?

Perhaps it would help if you could provide a *small* example program and 
  the command lines you use to compile it, as well as description of 
what is wrong with the resulting executable.

Cheers
   Nick


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-02-22  9:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-22 12:56 interworking problem aram bharathi
2005-02-22 14:45 ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).