Hi Sun,
The original code cuased a segmentation fault in ipa_link because the string
passed in is readonly. I made another change to resolve this issue:
Index: ipc_compile.cxx
===================================================================
--- ipc_compile.cxx (revision 3454)
+++ ipc_compile.cxx (working copy)
@@ -1112,7 +1112,7 @@
strcpy (tmpname, outfilename);
if (Feedback_Filename) {
fprintf(makefile, "\tcd %s; %s -Wb,-OPT:procedure_reorder=on
-fb_create %s %s -Wb,-CG:enable_feedback=off -TENV:object_name=_%s\n\n",
- tmpdir_macro, symtab_command_line, Feedback_Filename,
symtab_extra_args, proper_name((const string)ipa_basename(outfilename)));
+ tmpdir_macro, symtab_command_line, Feedback_Filename,
symtab_extra_args, proper_name((const string)ipa_basename(tmpname)));
} else if (Annotation_Filename) {
fprintf (makefile, "\t"
#ifdef KEY
@@ -1126,10 +1126,10 @@
#endif
tmpdir_macro, symtab_command_line,
Get_Annotation_Filename_With_Path (),
- symtab_extra_args, proper_name((const
string)ipa_basename(outfilename)));
+ symtab_extra_args, proper_name((const
string)ipa_basename(tmpname)));
} else {
fprintf(makefile, "\tcd %s; %s -Wb,-OPT:procedure_reorder=on
%s -Wb,-CG:enable_feedback=off -TENV:object_name=_%s\n\n",
- tmpdir_macro, symtab_command_line, symtab_extra_args,
proper_name((const string)ipa_basename(outfilename)));
+ tmpdir_macro, symtab_command_line, symtab_extra_args,
proper_name((const string)ipa_basename(tmpname)));
}
fprintf(makefile, "%s/%s" TARGET_DELIMITER "%s/%s %s/%s\n\n",
tmpdir_macro, elf_symtab_name,
outfilename is the original read-only string and tmpname is a copy of the
outfilename. Could you please review this patch? Thank you very much.
2011/1/12 Sun Chan <sun.c...@gmail.com>
> please go ahead (although I would have made "-" and "_" and #define in
> types.h or whichever host specific config file.)
> Sun
>
> On Tue, Jan 11, 2011 at 10:27 PM, Jian-Xin Lai <laij...@gmail.com> wrote:
> > Hi,
> >
> > Can a gatekeeper review the patch to bug 716? Thank you very much. The
> bug
> > 716 is caused by the special character '+', which is legal in file names
> but
> > illegal in identifiers. The original code only replaces the '-' by '_'.
> This
> > patch will replace all these kind of characters.
> >
> > Index: common/ipc_compile.cxx
> > ===================================================================
> > --- common/ipc_compile.cxx (revision 2052)
> > +++ common/ipc_compile.cxx (working copy)
> > @@ -208,7 +208,7 @@
> > */
> > static char* proper_name(char *name){
> > for(char *i = name; *i; i++) {
> > - if ( *i == '-' ) *i = '_';
> > + if ( !isalnum(*i) ) *i = '_';
> > }
> > return name;
> > }
> > Index: common/ipc_pic.cxx
> > ===================================================================
> > --- common/ipc_pic.cxx (revision 2052)
> > +++ common/ipc_pic.cxx (working copy)
> > @@ -63,7 +63,7 @@
> >
> > int i;
> > for(i=0; bname[i] != '\0'; i++) {
> > - if ( bname[i] == '-' ) IPA_Object_Name[i] = '_';
> > + if ( !isalnum(bname[i]) ) IPA_Object_Name[i] = '_';
> > else IPA_Object_Name[i] = bname[i];
> > }
> > IPA_Object_Name[i] = '\0';
> >
> >
> > --
> > Regards,
> > Lai Jian-Xin
> >
> >
> ------------------------------------------------------------------------------
> > Gaining the trust of online customers is vital for the success of any
> > company
> > that requires sensitive data to be transmitted over the Web. Learn how
> to
> > best implement a security strategy that keeps consumers' information
> secure
> > and instills the confidence they need to proceed with transactions.
> > http://p.sf.net/sfu/oracle-sfdevnl
> > _______________________________________________
> > Open64-devel mailing list
> > Open64-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/open64-devel
> >
> >
>
--
Regards,
Lai Jian-Xin
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand
malware threats, the impact they can have on your business, and how you
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel