This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v5] Fix dynamic linker issue with bind-now
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Petar Jovanovic <petar dot jovanovic at rt-rk dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>, Roland McGrath <roland at hack dot frob dot com>, Mike Frysinger <vapier at gentoo dot org>
- Date: Wed, 15 Jul 2015 11:31:05 -0700
- Subject: Re: [PATCH v5] Fix dynamic linker issue with bind-now
- Authentication-results: sourceware.org; auth=none
- References: <1436883776-79869-1-git-send-email-petar dot jovanovic at rt-rk dot com> <CAMe9rOpP4grHPgxxzwvR6SUJu9fa+rKMvo+O6tDNT8Svqj0neg at mail dot gmail dot com> <002e01d0bf2a$ea61e440$bf25acc0$ at rt-rk dot com>
On Wed, Jul 15, 2015 at 11:20 AM, Petar Jovanovic
<petar.jovanovic@rt-rk.com> wrote:
>
>>> +static int __attribute__ ((section(".bar"))) bar = 0x12345678;
>> Please make "bar" readonly to avoid writable and executable segment.
>
> As "static int const __attribute__ ..."?
> In that case, bar is removed from the sections list, likely due to some optimizations.
>
Please find a way. You can put
int const __attribute__ ((section(".bar"))) bar = 0x12345678;
in a separate file.
--
H.J.