8b6f4cd ld: Keep PREINIT_ARRAY/INIT_ARRAY/FINI_ARRAY sections for -r --gc-sections

Authored and Committed by H.J. Lu 6 years ago
    ld: Keep PREINIT_ARRAY/INIT_ARRAY/FINI_ARRAY sections for -r --gc-sections
    
    We must keep all PREINIT_ARRAY, INIT_ARRAY as well as FINI_ARRAY sections
    for ld -r --gc-sections.
    
    bfd/
    
    	PR ld/22677
    	* elflink.c (bfd_elf_gc_sections): Keep all PREINIT_ARRAY,
    	INIT_ARRAY as well as FINI_ARRAY sections for ld -r --gc-sections.
    
    ld/
    
    	PR ld/22677
    	* scripttempl/elf.sc (PREINIT_ARRAY): New.
    	Don't add .preinit_array for ld -r.
    	* testsuite/ld-elf/pr22677.d: New file.
    	* testsuite/ld-elf/pr22677.s: Likewise.
    
        
file modified
+6 -0
file modified
+9 -1
file modified
+8 -0
file modified
+7 -6