diff options
author | Ian Lance Taylor <ian@airs.com> | 1999-07-22 01:39:23 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1999-07-22 01:39:23 +0000 |
commit | 242eabea02320aecd550be46e84c2d27d4395770 (patch) | |
tree | df7c78a8fd9dc97a663e439d409171d9cc3a705f /bfd/coffcode.h | |
parent | b4089fdd75a051bffc729255e2e383779abbb4ca (diff) | |
download | gdb-242eabea02320aecd550be46e84c2d27d4395770.zip gdb-242eabea02320aecd550be46e84c2d27d4395770.tar.gz gdb-242eabea02320aecd550be46e84c2d27d4395770.tar.bz2 |
1999-07-21 Mark Elbrecht <snowball3@bigfoot.com>
* coffcode.h (styp_to_sec_flags): If COFF_LONG_SECTION_NAMES and
COFF_SUPPORT_GNU_LINKONCE, mark sections whose names begin with
.gnu.linkonce with SEC_LINKONCE and SEC_LINK_DUPLICATES_DISCARD.
* coff-go32.c: (COFF_LONG_SECTION_NAMES): Define.
(COFF_SUPPORT_GNU_LINKONCE): Define.
* coff-stgo32.c: (COFF_LONG_SECTION_NAMES): Define.
(COFF_SUPPORT_GNU_LINKONCE): Define.
Diffstat (limited to 'bfd/coffcode.h')
-rw-r--r-- | bfd/coffcode.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/bfd/coffcode.h b/bfd/coffcode.h index f905c94..185cbcf 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -687,6 +687,17 @@ styp_to_sec_flags (abfd, hdr, name) } #endif +#if defined (COFF_LONG_SECTION_NAMES) && defined (COFF_SUPPORT_GNU_LINKONCE) + /* As a GNU extension, if the name begins with .gnu.linkonce, we + only link a single copy of the section. This is used to support + g++. g++ will emit each template expansion in its own section. + The symbols will be defined as weak, so that multiple definitions + are permitted. The GNU linker extension is to actually discard + all but one of the sections. */ + if (strncmp (name, ".gnu.linkonce", sizeof ".gnu.linkonce" - 1) == 0) + sec_flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD; +#endif + return (sec_flags); } |