help-gplusplus
[Top][All Lists]
Advanced

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

help with relocating code


From: Pramod Srinivasan
Subject: help with relocating code
Date: Wed, 14 May 2003 23:20:20 -0700 (PDT)

Hi,

I am not sure if this is the right mailing list for
this message, please let me know if its not.

I wanted to move the .text, .data, .bss etc. to higher
virtual address space, but not sure how to do this.
Could someone help me with the gcc options.

Making the question more specific, here is the elf
dump of my test program...

ELF header:
ident=0x7F.45.4C.46. 1. 2. 1. 0. 0. 0. 0. 0. 0. 0. 0.
0.
type=0x2 machine=0x14 version=0x1 entry=0x1800430
phoff=0x34 shoff=0x28A0 flags=0x0 ehsize=0x34
phentsize=0x20 phunm=0x6 shentsize=0x28 shnum=0x1E
shstrndx=0x1B

program header 0:
type=0x6 offset=0x34 vaddr=0x1800034 paddr=0x1800034
filesz=0xE0 memsz=0xE0 flags=0x5 align=0x4
program header 1:
type=0x3 offset=0x114 vaddr=0x1800114 paddr=0x1800114
filesz=0x17 memsz=0x17 flags=0x4 align=0x1
program header 2:
type=0x1 offset=0x0 vaddr=0x1800000 paddr=0x1800000
filesz=0xA1C memsz=0xA1C flags=0x5 align=0x10000
program header 3:
type=0x1 offset=0xA20 vaddr=0x1840A20 paddr=0x1840A20
filesz=0x180 memsz=0x214 flags=0x7 align=0x10000
program header 4:
type=0x2 offset=0xA90 vaddr=0x1840A90 paddr=0x1840A90
filesz=0x88 memsz=0x88 flags=0x6 align=0x4
program header 5:
type=0x4 offset=0x12C vaddr=0x180012C paddr=0x180012C
filesz=0x34 memsz=0x34 flags=0x4 align=0x4

section header 0:
...<snipped>...
name=.text (0x56) type=0x1 flags=0x6 addr=0x180042C
offset=0x42C
size=0x530 link=0x0 info=0x0 addralign=0x4 entsize=0x0
section header 8:
name=.init (0x5C) type=0x1 flags=0x6 addr=0x180095C
offset=0x95C
size=0x68 link=0x0 info=0x0 addralign=0x4 entsize=0x0
section header 9:
name=.fini (0x62) type=0x1 flags=0x6 addr=0x18009C4
offset=0x9C4
size=0x50 link=0x0 info=0x0 addralign=0x4 entsize=0x0
section header 10:
name=.rodata (0x68) type=0x1 flags=0x2 addr=0x1800A14
offset=0xA14
size=0x8 link=0x0 info=0x0 addralign=0x4 entsize=0x0
section header 11:
name=.sdata2 (0x70) type=0x1 flags=0x2 addr=0x1800A1C
offset=0xA1C
size=0x0 link=0x0 info=0x0 addralign=0x4 entsize=0x0
section header 12:
name=.data (0x78) type=0x1 flags=0x3 addr=0x1840A20
offset=0xA20
size=0x70 link=0x0 info=0x0 addralign=0x4 entsize=0x0
section header 13:

I was wondering if it was possible to start all the
various segments from a address that I can specify on
command line, so that .text could start at va
0x7000000, instead of 0x1800000

Thanks a lot,
--pramod

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com




reply via email to

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