Question about ELF program headers
Mon Feb 26 20:38:00 GMT 2018
I'm using a cross compiler produced by Crosstools-NG v1.20.0.Â The cross
compiler runs in a 64-bit Intel-based Linux environment, and it produces
32-bit PowerPC code.Â The cross compiler uses gcc v4.4.7.
If I do a "readelf -a" command against the shared object (.so) files
produced by this cross compiler, I see something like this:
Â 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 that's flagged as RWE.Â A potential customer
evaluating some of our software can't use the shared libraries because
I tried adding --secure-plt to the gcc commands, but that didn't seem to
work; the RWE header is still there.
Is there a way to get the cross compiler to stop producing this RWE
header?Â Failing that, is there a way to (safely) modify an already
produced .so file to change the RWE setting to RW?
I'm kind of new to this world of cross compilers and ELF headers, so I'm
not sure how best to deal with this.
Objective Systems, Inc.
REAL WORLD ASN.1 AND XML SOLUTIONS
Tel: +1 (484) 875-9841
Fax: +1 (484) 875-9830
Toll-free: (877) 307-6855 (USA only)
More information about the crossgcc