PLT Problems in uBoot on MCF548x
Peter LaDow
pladow@gmail.com
Wed Aug 7 15:49:43 GMT 2024
On Tue, Aug 6, 2024 at 1:23 PM Maciej W. Rozycki <macro@orcam.me.uk> wrote:
> [Cc-ed back to the mailing list (I hope you don't mind) as Gmail doesn't
> want to accept e-mail from here and you wouldn't receive it otherwise.
> Also someone else might want to chime in, in particular who knows m68k.]
Doh! I somehow didn't do reply-all on that last one. Apologies.
> On Tue, 6 Aug 2024, Peter LaDow wrote:
> Can you double-check how the definitions of `_fault' and `_start' look
> like? If you're not sure where they come from after all (which can
> sometimes be confusing), then use the `-M' option to LD to print the link
> map, and it'll tell you the symbol's originating object file or whether
> it's come from a linker script instead.
Linker script and memory map
Address of section .text set to 0x0
.text 0x0000000000000000 0x2c204
arch/m68k/cpu/mcf548x/start.o(.text*)
.text 0x0000000000000000 0x554 arch/m68k/cpu/mcf548x/start.o
0x0000000000000400 _start
0x0000000000000474 relocate_code
0x000000000000050c _fault
0x0000000000000510 _exc_handler
0x0000000000000532 _int_handler
0x0000000000004000 . = DEFINED (env_offset)?env_o
> If it came from a piece of handcoded assembly, it would have to have the
> hidden visibility applied also by hand, with the `.hidden _start'
> pseudo-op, typically placed near the symbol definition. For a linker
> script definition there are the HIDDEN and PROVIDE_HIDDEN commands.
The _start symbol is not mentioned in the linker script, other than an
ENTRY(_start). I tried removing that, and there's no change in the
output.
> Then are there no dynamic relocations at all, not even relative ones
> referring no symbol? If so, then can you run `readelf -r' on the object
> module containing `_vectors' stuff and see what static relocations have
> been produced at assembly time?
There are relocations in start.o (which contains _start, _fault, and
_vectors). There are R_68K_32 and just a few R_68K_PC16. I note that
_fault is generated as R_68K_PC16. But the beginning of the vector
table does show _start (the remainder are _fault):
Relocation section '.rela.text' at offset 0x9e4 contains 271 entries:
Offset Info Type Sym.Value Sym. Name + Addend
00000004 00000f01 R_68K_32 00000400 _start + 0
00000008 00001001 R_68K_32 0000050c _fault + 0
...
I'm not sure what you mean by "referring no symbol." What am I looking for?
--
To love for the sake of being loved is human, but to love for the sake
of loving is angelic. -- Alphonse de Lamartine.
More information about the Binutils
mailing list