This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]