Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

I am using RVCT 3.0 for brew (demo version). I am able to compile and link my app (I am currently using a bare bones app with minimal functionality to run on a phone). When I load it onto the device and attempt to run it I get Unknown Error(37034160). I have tried to load it on multiple phones with the same result (the large number is different on different phones). Watching the logger, the AEEClsCreateInstance never gets executed before the failure. The same app compiles and runs with gnu. The flags I am using are (and I have tried many variations of these, but always get the same result):

set CFILES=C:\AIRPLAY\Projects\client\brew\lib\aee2.1\AEEAppGen.c C:\AIRPLAY\Projects\client\brew\lib\aee2.1\AEEModGen.c
set CPPFILES=C:\AIRPLAY\Projects\client\brew\TestSrc\AirplayMidlet.cpp
set ARMCCFLAGS=-c -D_RVCT -DDYNAMIC_APP --cpu ARM7TDMI-S --littleend --apcs=/interwork -Ilib/aee2.1
armcc %ARMCCFLAGS% %CFILES%
armcc %ARMCCFLAGS% %CPPFILES%
armlink --output out.elf --ro-base 0 --rw-base 0 --libpath "%RVCT30LIB%" --no_strict_ph --split --reloc --entry AEEMod_Load --first AEEMod_Load AEEModGen.o AEEAppGen.o AirplayMidlet.o
"C:\Program Files\Elf2Mod\bin\elf2mod" -output apbb.mod out.elf

I am using BREW SDK 2.1
It appears (after doing a readelf) that the AEEMod_Load function is not at 0x0 it is at 0x17c and its symbol visibility is Hidden. when I look at the static call graph output by the linker it says that AEEClsCreateInstance is unused.
here is the diff between readelf-a [realview elf] and readelf -a [gnu elf] :

< Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
---
> Magic: 7f 45 4c 46 01 01 01 61 00 00 00 00 00 00 00 00
6c6
< OS/ABI: UNIX - System V
---
> OS/ABI: ARM
11,14c11,14
< Entry point address: 0x17c
< Start of program headers: 3876 (bytes into file)
< Start of section headers: 3940 (bytes into file)
< Flags: 0x3000002, has entry point, Version3 EABI
---
> Entry point address: 0x0
> Start of program headers: 52 (bytes into file)
> Start of section headers: 36464 (bytes into file)
> Flags: 0x0

Notice the OS/ABI and Entry point are different. The gnu version (and realview 1.2) runs correctly on the phone.
Has anyone else experienced this/found a solution? We need to use 3.0 because of its better support for templates. Thanks.

Having had a look at my build system, I realised that I had this problem too, I'd just forgotten about it.
Stick
__attribute__((section("FirstSection")))
on the line before
int AEEMod_Load(....
that will put AEEMod_Load in its own section, and the --first linker option will then work properly.

Having had a look at my build system, I realised that I had this problem too, I'd just forgotten about it.
Stick
__attribute__((section("FirstSection")))
on the line before
int AEEMod_Load(....
that will put AEEMod_Load in its own section, and the --first linker option will then work properly.