From: Douglas Coup <dcoup@obj-sys.com>
To: crossgcc@sourceware.org
Subject: Question about ELF program headers
Date: Mon, 26 Feb 2018 20:38:00 -0000 [thread overview]
Message-ID: <2c033694-18e1-312b-4bb9-90d2d353989c@obj-sys.com> (raw)
Hello all.
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:
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 that's flagged as RWE. A potential customer
evaluating some of our software can't use the shared libraries because
of this.
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.
Regards,
Douglas Coup
--
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)
http://www.obj-sys.com
reply other threads:[~2018-02-26 20:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2c033694-18e1-312b-4bb9-90d2d353989c@obj-sys.com \
--to=dcoup@obj-sys.com \
--cc=crossgcc@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).