On 17/03/11 06:27, HV wrote:
Hi,

I have a custom library in which I'm not sure if the code & data sections are being mapped correctly. I see that all the C++ methods are listed under the .rodata section. Don't they have to be under .text?
Sounds like you are right.
The C functions however are properly listed under .text. Is there any compiler/linker option that needs to be enabled?
The section allocation is initially triggered by the compiler, not the linker. Absent a linker control file, the linker mostly collects all of the similar sections from the various .o files into one section.

What you want to do is objdump the .o files and check what the compiler is doing there.

The problem I'm having is, once this library is loaded (by the caller using dlopen), there is a crash that manifests somewhere else.
rodata is mapped without an executable flag of the memory. I'm not sure whether ARM enforces that, but if it does, trying to run your C++ methods will cause a segmentation fault.

Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
http://www.lingnu.com

--
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

Reply via email to