This is the mail archive of the gdb@sourceware.org mailing list for the GDB 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]

Re: relocations when doing file command at gdb prompt


On Thu, Mar 08, 2007 at 04:49:06PM +0100, Roland Puntaier wrote:
> > So, are you loading an object file or a linked program? 
> An object file.

Actually, ET_DYN is not quite either.  It's more like a linked program
for the purpose of my question.

> > Does it have relocations included? 
> Yes

>                     [Elf32_Stab]
>                     n_strx:                        0x14      
>                     n_type:                        0x64      
>                     n_other:                       0x0       
>                     n_desc:                        0x2       
>                     n_value:                       0x8048238 

>                     [Elf32_Rel]
>                     r_offset:                      0x14      
>                     r_info:                        0x601      --> ELF32_R_SYM:0x6, ELF32_R_TYPE:0x1(R_386_32)

So, it's relocated already, but the relocations are still present.
No wonder GDB is doubling them.

This code was originally added for shared libraries (ET_DYN).  Those
generated by the GNU binutils at the time had relocations in shared
libraries that had _not_ been applied.

I don't see how we can sensibly distinguish the two cases.  What
toolchain produced this file?

-- 
Daniel Jacobowitz
CodeSourcery


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