[Gc] Re: [PATCH] Dealing with `.data.rel.ro'

Ludovic Courtès ludo at gnu.org
Wed Apr 29 01:07:52 PDT 2009


"Boehm, Hans" <hans.boehm at hp.com> writes:

> I assume GNU_RELRO sections can include const data, not just things
> like exception range tables?

It typically contains relocatable read-only data, such as constant
pointers to global variables.  It may be that exception tables fall into
this category, I don't know.

> Thus it's not implausible that a user would call
> GC_exclude_static_roots on something inside a GNU_RELRO section?

Yes, although users could assume that `const'-qualified areas are not
scanned by default, regardless of whether they are relocatable or not (I
mean, an application writer doesn't necessarily pay attention to this).

> Eventhough it seems a bit ugly to have two rather similar facilities,
> I'd still be inclined to just track GNU_RELRO calls in a separate
> array in dyn_load.c, and then process them when we see the
> corresponding LOAD section during the next GC.  Since the number of
> static root segments currently already has a static bound
> (MAX_ROOT_SETS), I don't think this would be terribly hard.  Again, I
> can try to generate the code if you're in a position to do some
> testing on the revised patch.

Fine by me, especially since you know more about the implications of
such a change than I do.  I'll be happy to test it when it's ready.

Thank you!


More information about the Gc mailing list