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

[microblaze-uclinux] Kernel crash debug: No code generated for 'get_romfs_base()' function?



OK, I'm homing in on this one...

I was just single-stepping through the early boot sequence, under control of
gdb, and noticed that I couldn't stop on lines 153 or 154 of 'machine.c'.
Furthermore, those 2 lines didn't appear to be getting executed properly.
For instance, the 'get_romfs_base' function simply returns the starting
address of the '.BSS' segment. However, when I arrived at line 156, below, I
found 'src' to be equal to '0'! 'len' was also equal to '0'. And, so, no
copying of the '.romfs' section was being performed and, therefore, some of
my '.romfs' data was getting wiped out when the '.BSS' section was zeroed
out in the subsequent lines of code. (I can't imagine that having any of my
'.romfs' section erased is healthy.)

I was very curious as to why these 2 lines were getting skipped. So, I used
gdb's 'info line' command to take a peek at them. I found (as you can see,
below) that there was no code being generated for them!!! (Incidentally, all
this analysis was performed immediately after freshly downloading both the
bit stream and the RAM image and before any instructions were allowed to
execute, just to ensure that I was not seeing the product of program
corruption due to errant code.)

-------------- GDB session output begins here. -----------------------

(gdb) l machine.c:150,156
150             } while (src < &_intv_load_end);
151
152             /* Copy ROMFS above bss */
153             src=get_romfs_base();
154             len=get_romfs_len(src);
155
156             if(len)
(gdb) info line machine.c:150
Line 150 of "machine.c" starts at address 0xfe125ab8 <mach_early_init+72>
and ends at 0xfe125ac0 <mach_early_init+80>.
(gdb) info line machine.c:153
Line 153 of "machine.c" is at address 0xfe125ae4 <mach_early_init+116> but
contains no code.
(gdb) info line machine.c:154
Line 154 of "machine.c" is at address 0xfe125ae4 <mach_early_init+116> but
contains no code.
(gdb) info line machine.c:156
Line 156 of "machine.c" starts at address 0xfe125ae4 <mach_early_init+116>
and ends at 0xfe125aec <mach_early_init+124>.

-------------- GDB session output endss here. -----------------------

Does anyone have any ideas as to what I might be doing wrong that could
cause the compiler to not generate code for these 2 lines?

Thanks,

David Banas
Field Applications Engineer
Nu Horizons Electronics Corp.
2070 Ringwood Avenue
San Jose, CA 95131
(408)434-0800 - office
(415)846-5837 - cell
http://www.nuhorizons.com

<<attachment: winmail.dat>>