public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Illegal instruction After base addr alterd
@ 2005-04-08  3:01 Zhenyu Guo
  2005-04-08  3:44 ` James E Wilson
  0 siblings, 1 reply; 4+ messages in thread
From: Zhenyu Guo @ 2005-04-08  3:01 UTC (permalink / raw)
  To: 'Binutils'

Hi there,
	I'm trying to change the base addr of an application so that I
can load other usual static linked elf at the specified image base on
Itanium, say 0x400000...
	I've done the following changes in my linker script:
	/* Read-only sections, merged into text segment: */
	  . = 0x5000000000000000 + SIZEOF_HEADERS; <<-- used to be
0x4000000000000000 

	 /* Adjust the address for the data segment.  We want to adjust
up to
	     the same address within the page on the next page up.  */
  	. = 0x7000000000000000 + (. & (0x10000 - 1)); << -- used to be
0x6000000000000000 

	Then I compiled my program and executed it, got "Illegal
instruction" msg.
	And gdb told me a bit more:
		Program received signal SIGILL, Illegal instruction.
		0x2000000000003c80 in ?? ()

	And readelf told me:
Elf file type is EXEC (Executable file)
Entry point 0x50000000000004a0
There are 7 program headers, starting at offset 64

Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  PHDR           0x0000000000000040 0x5000000000000040
0x5000000000000040
                 0x0000000000000188 0x0000000000000188  R E    8
  INTERP         0x00000000000001c8 0x50000000000001c8
0x50000000000001c8
                 0x0000000000000018 0x0000000000000018  R      1
      [Requesting program interpreter: /lib/ld-linux-ia64.so.2]
  LOAD           0x0000000000000000 0x5000000000000000
0x5000000000000000
                 0x0000000000000c48 0x0000000000000c48  R E    10000
  LOAD           0x0000000000000c48 0x7000000000000c48
0x7000000000000c48
                 0x0000000000000298 0x00000000000002a8  RW     10000
  DYNAMIC        0x0000000000000c58 0x7000000000000c58
0x7000000000000c58
                 0x00000000000001c0 0x00000000000001c0  RW     8
  NOTE           0x00000000000001e0 0x50000000000001e0
0x50000000000001e0
                 0x0000000000000020 0x0000000000000020  R      4
  IA_64_UNWIND   0x0000000000000bd0 0x5000000000000bd0
0x5000000000000bd0
                 0x0000000000000078 0x0000000000000078  R      8

	BTW, after gdbed this altered program, the itanium machine is
down:(
	Anybody tell me what is going on and what  I should do?
Thanks,
Zhenyu

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: Illegal instruction After base addr alterd
@ 2005-04-08  3:51 Zhenyu Guo
  2005-04-08  4:59 ` Ian Wienand
  0 siblings, 1 reply; 4+ messages in thread
From: Zhenyu Guo @ 2005-04-08  3:51 UTC (permalink / raw)
  To: 'Binutils'

Ok, I've found that the vma bits[51...60] are not implemented on
Itanium, so addr 0x5000000000000000 (0x7000000000000000 ) is invalid.
I've changed to 0x4000100000000000 this time. There is no Illegal
instruction err then.
However, I failed running the ''hello world!" again. The app seemed
asleep.
The stopped addr is 0x2000000000003c80.
Any ideas?
Thanks,
Zhenyu

-----邮件原件-----
发件人: Zhenyu Guo [mailto:guozy03@mails.tsinghua.edu.cn] 
发送时间: 2005年4月8日 11:03
收件人: 'Binutils (binutils@sources.redhat.com)'
主题: Illegal instruction After base addr alterd


Hi there,
	I'm trying to change the base addr of an application so that I
can load other usual static linked elf at the specified image base on
Itanium, say 0x400000...
	I've done the following changes in my linker script:
	/* Read-only sections, merged into text segment: */
	  . = 0x5000000000000000 + SIZEOF_HEADERS; <<-- used to be
0x4000000000000000 

	 /* Adjust the address for the data segment.  We want to adjust
up to
	     the same address within the page on the next page up.  */
  	. = 0x7000000000000000 + (. & (0x10000 - 1)); << -- used to be
0x6000000000000000 

	Then I compiled my program and executed it, got "Illegal
instruction" msg.
	And gdb told me a bit more:
		Program received signal SIGILL, Illegal instruction.
		0x2000000000003c80 in ?? ()

	And readelf told me:
Elf file type is EXEC (Executable file)
Entry point 0x50000000000004a0
There are 7 program headers, starting at offset 64

Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  PHDR           0x0000000000000040 0x5000000000000040
0x5000000000000040
                 0x0000000000000188 0x0000000000000188  R E    8
  INTERP         0x00000000000001c8 0x50000000000001c8
0x50000000000001c8
                 0x0000000000000018 0x0000000000000018  R      1
      [Requesting program interpreter: /lib/ld-linux-ia64.so.2]
  LOAD           0x0000000000000000 0x5000000000000000
0x5000000000000000
                 0x0000000000000c48 0x0000000000000c48  R E    10000
  LOAD           0x0000000000000c48 0x7000000000000c48
0x7000000000000c48
                 0x0000000000000298 0x00000000000002a8  RW     10000
  DYNAMIC        0x0000000000000c58 0x7000000000000c58
0x7000000000000c58
                 0x00000000000001c0 0x00000000000001c0  RW     8
  NOTE           0x00000000000001e0 0x50000000000001e0
0x50000000000001e0
                 0x0000000000000020 0x0000000000000020  R      4
  IA_64_UNWIND   0x0000000000000bd0 0x5000000000000bd0
0x5000000000000bd0
                 0x0000000000000078 0x0000000000000078  R      8

	BTW, after gdbed this altered program, the itanium machine is
down:(
	Anybody tell me what is going on and what  I should do? Thanks,
Zhenyu

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

end of thread, other threads:[~2005-04-08  4:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-08  3:01 Illegal instruction After base addr alterd Zhenyu Guo
2005-04-08  3:44 ` James E Wilson
2005-04-08  3:51 Zhenyu Guo
2005-04-08  4:59 ` Ian Wienand

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).