I'm using a cross compiler on a 64-bit Intel-based Linux system to build some of our software so it can run on a 32-bit PowerPC chip. The cross compiler was produced by Crosstools.
When I run "readelf -a" against the shared object files (.so files) produced by the cross compiler, part of the output shows this:
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
LOAD 0x000000 0x00000000 0x00000000 0x9a87c 0x9a87c R E 0x10000
LOAD 0x09a87c 0x000aa87c 0x000aa87c 0x01344 0x03230 RWE 0x10000
DYNAMIC 0x09ba84 0x000aba84 0x000aba84 0x000d0 0x000d0 RW 0x4
GNU_EH_FRAME 0x09a7bc 0x0009a7bc 0x0009a7bc 0x0002c 0x0002c R 0x4
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RW 0x4
The problem is that header marked RWE. A potential customer evaluating our software has issues with that and wants it to be just RW.
A second cross compiler, produced by the same version of Crosstools and targeting the same version of gcc, produces code for 64-bit PowerPC chips. The shared object files produced by this cross compiler do not produce any RWE headers (the second LOAD header is marked just RW).
The qualifiers for gcc for both the compiles and the links are the same in both cases.
I'm kind of new to the world of cross compilers and ELF headers. Is there a way to get the 32-bit cross compiler to create shared object files without a header marked RWE?
Failing that, is there a way to (safely) patch an already created .so file to change a header marked RWE so it's marked RW?