[RTEMS Project] #4266: motorola_powerpc bootloader images not linking correctly
RTEMS trac
trac at rtems.org
Fri Feb 26 04:19:33 UTC 2021
#4266: motorola_powerpc bootloader images not linking correctly
-------------------------+--------------------------
Reporter: Chris Johns | Owner: Chris Johns
Type: defect | Status: reopened
Priority: normal | Milestone: 5.2
Component: bsps | Version: 5
Severity: normal | Resolution:
Keywords: | Blocked By:
Blocking: |
-------------------------+--------------------------
Changes (by Chris Johns):
* status: closed => reopened
* resolution: fixed =>
Comment:
The change does not resolve the issue. I am not sure what happened in my
testing.
The bootloader linked executable has the `.text.*` sections present. I am
wondering if the Motorola debug monitor is not capable of loaded this type
of ELF file. As a result the card information is not found and boot
process fails. You can observe this by running `readelf -a` on the
`rtems.img.elf` file created when making the image file. This is the RTEMS
5 executable linked with the RTEMS 6 bootloader:
{{{
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk
Inf Al
[ 0] NULL 00000000 000000 000000 00 0
0 0
[ 1] .text PROGBITS 00000000 010000 00f145 00 AX 0
0 32
[ 2] .eh_frame PROGBITS 0000f148 01f148 0017e0 00 A 0
0 4
[ 3] .image PROGBITS 00010928 020928 017778 00 WA 0
0 1
[ 4] .reloc PROGBITS 000280a0 0380a0 0002bc 00 WA 0
0 4
[ 5] .handlers PROGBITS 0002835c 03835c 0003ac 00 WA 0
0 1
[ 6] .data PROGBITS 00028720 038720 003c80 00 WA 0
0 32
[ 7] .bss NOBITS 0002c3a0 03c3a0 001158 00 WA 0
0 32
[ 8] .gnu.attributes GNU_ATTRIBUTES 00000000 03c3a0 000010 00 0
0 1
[ 9] .symtab SYMTAB 00000000 03c3b0 0066c0 10 10
698 4
[10] .strtab STRTAB 00000000 042a70 00616c 00 0
0 1
[11] .shstrtab STRTAB 00000000 048bdc 00005e 00 0
0 1
}}}
The RTEMS 6 executable has more code than the RTEMS 5. I tried a number of
combinations in the linker command script but could not find a suitable
result.
I have now looked into fixing the building of the bootloader in the RTEMS
5 `automake` build system and there are some fundamental issues present
and I am yet to decide how this is to be resolved.
The bootloader `Makefile` has a variable `BOOTLOADER_CPU_FLAGS`:
https://git.rtems.org/rtems/tree/c/src/lib/libbsp/powerpc/motorola_powerpc/bootloader/Makefile.am?h=5#n22
This is empty because `CPU_FLAGS` is not exported into this file:
{{{
$ grep CPU_FLAGS powerpc-
rtems5/c/mvme2307/lib/libbsp/powerpc/motorola_powerpc/bootloader/Makefile
$
}}}
The CPU flags are being provided the globally set `CFLAGS` and this
includes the text and data segment flags which is causing the problem.
Adding:
{{{
CFLAGS =
CPPFLAGS =
CCASFLAGS =
}}}
Results in no valid CPU flags being set.
I am reluctant to add exporting the CPU flags to a high level in the build
process because it will be seen by all BSPs and it is very difficult to
know if there are possible side effects in another BSP.
I cannot only see a couple of solutions:
1. Remove the problem flags from the build
2. Find a way to include the config with the flags
--
Ticket URL: <http://devel.rtems.org/ticket/4266#comment:2>
RTEMS Project <http://www.rtems.org/>
RTEMS Project
More information about the bugs
mailing list