From: Kai Tietz Date: Fri, 16 Jan 2009 15:09:20 +0000 (+0000) Subject: 2009-01-16 Kai Tietz X-Git-Tag: sid-snapshot-20090201~137 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f6d29e26d6bf24dfcc42558390082aeb7ac034e5;p=thirdparty%2Fbinutils-gdb.git 2009-01-16 Kai Tietz * coffcode.h (styp_to_sec_flags): Correct interpretation of IMAGE_SCN_MEM_DISCARDABLE. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 8622dff7e2c..3cac4b4267c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2009-01-16 Kai Tietz + + * coffcode.h (styp_to_sec_flags): Correct interpretation of + IMAGE_SCN_MEM_DISCARDABLE. + 2009-01-16 Alan Modra * Makefile.am (libbfd_la_LIBADD, libbfd_la_LDFLAGS): Substitute diff --git a/bfd/coffcode.h b/bfd/coffcode.h index 12d2ad5f2cf..db0b2e9006e 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -1069,10 +1069,19 @@ styp_to_sec_flags (bfd *abfd, sec_flags &= ~ SEC_READONLY; break; case IMAGE_SCN_MEM_DISCARDABLE: - /* The MS PE spec sets the DISCARDABLE flag on .reloc sections - but we do not want them to be labelled as debug section, since - then strip would remove them. */ - if (! CONST_STRNEQ (name, ".reloc")) + /* The MS PE spec says that debug sections are DISCARDABLE, + but the presence of a DISCARDABLE flag does not necessarily + mean that a given section contains debug information. Thus + we only set the SEC_DEBUGGING flag on sections that we + recognise as containing debug information. */ + if (CONST_STRNEQ (name, DOT_DEBUG) +#ifdef _COMMENT + || strcmp (name, _COMMENT) == 0 +#endif +#ifdef COFF_LONG_SECTION_NAMES + || CONST_STRNEQ (name, GNU_LINKONCE_WI) +#endif + || CONST_STRNEQ (name, ".stab")) sec_flags |= SEC_DEBUGGING; break; case IMAGE_SCN_MEM_SHARED: