Need to modify the Program Header info

Fahd Abidi fabidi at ultsol.com
Wed Jan 28 02:44:33 EST 2004


Hello all,

I have a situation where the program headers built into an ELF executable
seem like they are incorrect. The target is an MPC5200,  Here are the
program header and section header info:

Program Header:
    LOAD off    0x00000000 vaddr 0x80000000 paddr 0x80000000 align 2**16
         filesz 0x00009fc0 memsz 0x00009fc0 flags rwx

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         00001f80  80008000  80008000  00008000  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .data         00000040  80009f80  80009f80  00009f80  2**2
                  CONTENTS, ALLOC, LOAD, DATA
  2 .bss          00000000  80009fc0  80009fc0  00009fc0  2**0
                  ALLOC
  3 .stab         0000219c  80009fc0  80009fc0  00009fc0  2**2
                  CONTENTS, READONLY, DEBUGGING
  4 .comment      00000098  8000d838  8000d838  0000c15c  2**0
                  CONTENTS, READONLY
  5 .stabstr      000016dc  8000c15c  8000c15c  0000c1f4  2**0
                  CONTENTS, READONLY, DEBUGGING

The Section header displays the correct load address, file offset and
Alignment information. The program header is incorrect. Does anyone know of
a way to modify the program header without messing around with the ld
script? I looked at objcopy and it seemed like it might do the trick but I
can't figure out what commands to use to change the program header
information.

Thanks for the help!!

Fahd Abidi
Field Applications Engineer
Ultimate Solutions, Inc.
=================================================
Professional Development Tools for Embedded Systems
Toll Free: 866-455-3383 x205
Facsimile: 978-926-3091
Email: fabidi at ultsol.com
www: http://www.ultsol.com
FAQ: http://www.ultsol.com/Faqs.htm


begin 666 ATT00047.htm
M/"%$3T-465!%($A434P at 4%5"3$E#("(M+R]7,T,O+T141"!(5$U,(#,N,B\O
M14XB/@T*/$A434P^#0H\2$5!1#X-"CQ-151!($A45% M15%5258](D-O;G1E
M;G0M5'EP92(@0T].5$5.5#TB=&5X="]H=&UL.R!C:&%R<V5T/5=I;F1O=W,M
M,3(U,B(^#0H\345402!.04U%/2)'96YE<F%T;W(B($-/3E1%3E0](DU3($5X
M8VAA;F=E(%-E<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3$]!1"P at 1$%403PO1D].5#X-"@T*/$)2/CQ&3TY4
M(%-)6D4],CXF;F)S<#L@,B N8G-S)FYB<W [)FYB<W [)FYB<W [)FYB<W [
M)FYB<W [)FYB<W [)FYB<W [)FYB<W [)FYB<W [(# P,# P,# P)FYB<W [
M(#@P,# Y9F,P)FYB<W [(#@P,# Y9F,P)FYB<W [(# P,# Y9F,P)FYB<W [
M(#(J*C \+T9/3E0^#0H-"CQ"4CX\1D].5"!325I%/3(^)FYB<W [)FYB<W [
M)FYB<W [)FYB<W [)FYB<W [)FYB<W [)FYB<W [)FYB<W [)FYB<W [)FYB
M<W [)FYB<W [)FYB<W [)FYB<W [)FYB<W [)FYB<W [)FYB<W [)FYB<W [
M($%,3$]#/"]&3TY4/@T*#0H\0E(^/$9/3E0 at 4TE:13TR/B9N8G-P.R S("YS
M=&%B)FYB<W [)FYB<W [)FYB<W [)FYB<W [)FYB<W [)FYB<W [)FYB<W [
M)FYB<W [(# P,# R,3EC)FYB<W [(#@P,# Y9F,P)FYB<W [(#@P,# Y9F,P
M)FYB<W [(# P,# Y9F,P)FYB<W [(#(J*C(\+T9/3E0^#0H-"CQ"4CX\1D].
M5"!325I%/3(^)FYB<W [)FYB<W [)FYB<W [)FYB<W [)FYB<W [)FYB<W [
M)FYB<W [)FYB<W [)FYB<W [)FYB<W [)FYB<W [)FYB<W [)FYB<W [)FYB
M<W [)FYB<W [)FYB<W [)FYB<W [($-/3E1%3E13+"!214%$3TY,62P at 1$5"
M54='24Y'/"]&3TY4/@T*#0H\0E(^/$9/3E0 at 4TE:13TR/B9N8G-P.R T("YC
M;VUM96YT)FYB<W [)FYB<W [)FYB<W [)FYB<W [)FYB<W [(# P,# P,#DX
M)FYB<W [(#@P,#!D.#,X)FYB<W [(#@P,#!D.#,X)FYB<W [(# P,#!C,35C
M)FYB<W [(#(J*C \+T9/3E0^#0H-"CQ"4CX\1D].5"!325I%/3(^)FYB<W [
M)FYB<W [)FYB<W [)FYB<W [)FYB<W [)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embedded mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-embedded mailing list