From 4153b6dbb0f38a16fd5b583761aa811212fbb9a5 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 22 Mar 2016 12:25:08 +0000 Subject: Improve COFF/PE linker garbage collection by preventing the removal of sections containing exported symbols. PR ld/19803 * ldlang.c (lang_add_gc_name): New function. Adds the provided symbol name to the list of gc symbols. (lang_process): Call lang_add_gc_name with entry_symbol_default if entry_symbol.name is NULL. Use lang_add_gc_name to add the init and fini function names. * pe-dll.c (process_def_file_and_drectve): Add exported names to the gc symbol list. * testsuite/ld-pe/pr19803.s: Do not export _testval symbol. * testsuite/ld-pe/pr19803.d: Tweak expected output. --- ld/ldlang.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ld/ldlang.h') diff --git a/ld/ldlang.h b/ld/ldlang.h index c3d1185..65d768b 100644 --- a/ld/ldlang.h +++ b/ld/ldlang.h @@ -693,4 +693,7 @@ lang_ld_feature (char *); extern void lang_print_memory_usage (void); +extern void +lang_add_gc_name (const char *); + #endif -- cgit v1.1