Re: Relocating Static Local Variables BUG?

Daniel Jacobowitz
2004-04-23T16:41:30Z

On Fri, Apr 23, 2004 at 12:36:41PM -0400, Richard Schmitt wrote:
>
> The version of GCC is 3.3.1
> The version of GDB is 6.1 (downloaded latest release)
>
> The commands to generate the elf are:
>
> gcc -o test.exe -g test.c
> objcopy -O elf32-little test.exe test.elf
>
> Built this way, the code is not relocatable, so there is no output of the
> -r command to readelf. I've done it this way just to demonstrate the
> issue that gdb has with relocating symbols, which is independent of code
> generated as relocatable. The -s output is shown below.

Well, it's not surprising that doesn't work. You are taking
non-relocatable output, and giving GDB offsets at which to relocate it.
The debug information no longer has relocation information, since final
relocation has already been performed.

I assume that's your simplified testcase rather than the one you were
actually trying to debug, and you've oversimplified it - since f you
needed to have .bss at the offset you told GDB about, then your code
would be referencing it in the wrong place. How is the original code
for your target built?

--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer