summaryrefslogtreecommitdiff
path: root/gcc/collect2.c
diff options
context:
space:
mode:
authorbrendan <brendan@138bc75d-0d04-0410-961f-82ee72b054a4>1996-12-11 23:58:22 +0000
committerbrendan <brendan@138bc75d-0d04-0410-961f-82ee72b054a4>1996-12-11 23:58:22 +0000
commit58c3cb6886b350211eda265d57c23bf16484d236 (patch)
tree0444499903b8c6465c0e9bafd488e95e1e58abbb /gcc/collect2.c
parent9a7aa5dfdd1dd56e7b99ca1e4800ed1e8a9b4eb6 (diff)
downloadgcc-58c3cb6886b350211eda265d57c23bf16484d236.tar.gz
* collect2.c (write_c_file): Wrap the ctor/dtor lists and fns with
`extern "C" { ... }', to avoid having the fn names mangled with the C++ driver. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13288 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/collect2.c')
-rw-r--r--gcc/collect2.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/collect2.c b/gcc/collect2.c
index 452ac9943ef..341c70ea045 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -1789,12 +1789,14 @@ write_c_file (stream, name)
FILE *stream;
char *name;
{
+ fprintf (stream, "#ifdef __cplusplus\nextern \"C\" {\n#endif\n");
#ifndef LD_INIT_SWITCH
if (! shared_obj)
write_c_file_glob (stream, name);
else
#endif
write_c_file_stat (stream, name);
+ fprintf (stream, "#ifdef __cplusplus\n}\n#endif\n");
}
static void