Page MenuHomeFreeBSD

D48700.diff
No OneTemporary

D48700.diff

diff --git a/lib/csu/common/crtbegin.c b/lib/csu/common/crtbegin.c
--- a/lib/csu/common/crtbegin.c
+++ b/lib/csu/common/crtbegin.c
@@ -66,19 +66,27 @@
(crt_func)-1
};
+extern const char startof_dtors[] __asm(".startof..dtors")
+ __weak_symbol __hidden;
+extern const char sizeof_dtors[] __asm(".sizeof..dtors")
+ __weak_symbol __hidden;
+
static void
__do_global_dtors_aux(void)
{
crt_func fn;
+ uintptr_t dtors_end;
int n;
#ifdef SHARED
run_cxa_finalize();
#endif
+ dtors_end = (uintptr_t)&startof_dtors + (uintptr_t)&sizeof_dtors;
for (n = 1;; n++) {
fn = __DTOR_LIST__[n];
- if (fn == (crt_func)0 || fn == (crt_func)-1)
+ if (fn == (crt_func)0 || fn == (crt_func)-1 || (dtors_end > 0 &&
+ (uintptr_t)&__DTOR_LIST__[n] >= dtors_end))
break;
fn();
}

File Metadata

Mime Type
text/plain
Expires
Sun, Feb 16, 8:11 AM (15 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16325157
Default Alt Text
D48700.diff (799 B)

Event Timeline