@@ -867,34 +867,29 @@ fn get_metadata_section_imp(target: &Target, flavor: CrateFlavor, filename: &Pat
867867}
868868
869869pub fn meta_section_name ( target : & Target ) -> & ' static str {
870+ // Historical note:
871+ //
872+ // When using link.exe it was seen that the section name `.note.rustc`
873+ // was getting shortened to `.note.ru`, and according to the PE and COFF
874+ // specification:
875+ //
876+ // > Executable images do not use a string table and do not support
877+ // > section names longer than 8 characters
878+ //
879+ // https://msdn.microsoft.com/en-us/library/windows/hardware/gg463119.aspx
880+ //
881+ // As a result, we choose a slightly shorter name! As to why
882+ // `.note.rustc` works on MinGW, that's another good question...
883+
870884 if target. options . is_like_osx {
871- "__DATA,__note.rustc"
872- } else if target. options . is_like_msvc {
873- // When using link.exe it was seen that the section name `.note.rustc`
874- // was getting shortened to `.note.ru`, and according to the PE and COFF
875- // specification:
876- //
877- // > Executable images do not use a string table and do not support
878- // > section names longer than 8 characters
879- //
880- // https://msdn.microsoft.com/en-us/library/windows/hardware/gg463119.aspx
881- //
882- // As a result, we choose a slightly shorter name! As to why
883- // `.note.rustc` works on MinGW, that's another good question...
884- ".rustc"
885+ "__DATA,.rustc"
885886 } else {
886- ".note. rustc"
887+ ".rustc"
887888 }
888889}
889890
890- pub fn read_meta_section_name ( target : & Target ) -> & ' static str {
891- if target. options . is_like_osx {
892- "__note.rustc"
893- } else if target. options . is_like_msvc {
894- ".rustc"
895- } else {
896- ".note.rustc"
897- }
891+ pub fn read_meta_section_name ( _target : & Target ) -> & ' static str {
892+ ".rustc"
898893}
899894
900895// A diagnostic function for dumping crate metadata to an output stream
0 commit comments