https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84847
--- Comment #18 from rguenther at suse dot de <rguenther at suse dot de> --- On March 13, 2018 5:15:33 PM GMT+01:00, "nickc at gcc dot gnu.org" <gcc-bugzi...@gcc.gnu.org> wrote: >https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84847 > >--- Comment #16 from Nick Clifton <nickc at gcc dot gnu.org> --- >Hi H.J. > >(In reply to H.J. Lu from comment #15) >> It should be fixed in linker. > >OK - so how does the linker distinguish between a file that only >contains >debug information, none of which is needed, and a file that only >contains >debug information of which some/all actually is needed ? There are used symbols and associated debug sections need to be kept. If nothing references the debug it can be discarded. >Cheers > Nick