From: Kjetil Matheussen Date: Fri, 15 Jul 2016 12:00:26 +0000 (+0200) Subject: Do not warn of missing PT_GNU_RELRO segment when custom DSO filter used X-Git-Tag: gc7_6_0~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1dee912de210c630f415e982d09179560c14f713;p=gc Do not warn of missing PT_GNU_RELRO segment when custom DSO filter used It is most likely that it is not found just because the segment had been excluded. Alternatively, we could have registered all segments, and checked the callback afterwards, but then we could break programs that rely on GC_has_static_roots_func to avoid overflowing the maximum number of roots. In addition, it would make the logic slightly more complicated, probably without a very good reason since the chance of this warning to show without the segment being excluded is likely to be none. * dyn_load.c [HAVE_DL_ITERATE_PHDR] (GC_register_dynlib_callback): Do not call WARN() if GC_has_static_roots callback is set. --- diff --git a/dyn_load.c b/dyn_load.c index b6880ab9..c0f9c5b3 100644 --- a/dyn_load.c +++ b/dyn_load.c @@ -506,8 +506,11 @@ STATIC int GC_register_dynlib_callback(struct dl_phdr_info * info, } break; } - if (j == 0) WARN("Failed to find PT_GNU_RELRO segment" - " inside PT_LOAD region\n", 0); + if (0 == j && 0 == GC_has_static_roots) + WARN("Failed to find PT_GNU_RELRO segment" + " inside PT_LOAD region\n", 0); + /* No warning reported in case of the callback is present */ + /* because most likely the segment has been excluded. */ } }