public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "ian at airs dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug other/54800] libiberty/simple-object-mach-o.c:704: possible optimisation ? Date: Tue, 01 Jan 2013 16:34:00 -0000 [thread overview] Message-ID: <bug-54800-4-5RQX1HZiOS@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-54800-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54800 Ian Lance Taylor <ian at airs dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ian at airs dot com --- Comment #2 from Ian Lance Taylor <ian at airs dot com> 2013-01-01 16:34:09 UTC --- I think the correct patch is the following, but I have no way to test it. Index: simple-object-mach-o.c =================================================================== --- simple-object-mach-o.c (revision 194764) +++ simple-object-mach-o.c (working copy) @@ -701,12 +701,13 @@ simple_object_mach_o_segment (simple_obj /* Otherwise, make a name like __segment,__section as per the convention in mach-o asm. */ name = &namebuf[0]; - memset (namebuf, 0, MACH_O_NAME_LEN * 2 + 2); memcpy (namebuf, (char *) sechdr + segname_offset, MACH_O_NAME_LEN); + namebuf[MACH_O_NAME_LEN] = '\0'; l = strlen (namebuf); namebuf[l] = ','; memcpy (namebuf + l + 1, (char *) sechdr + sectname_offset, MACH_O_NAME_LEN); + namebuf[l + 1 + MACH_O_NAME_LEN] = '\0'; } simple_object_mach_o_section_info (omr->is_big_endian, is_32, sechdr,
next prev parent reply other threads:[~2013-01-01 16:34 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-10-03 21:21 [Bug other/54800] New: " dcb314 at hotmail dot com 2012-10-03 21:22 ` [Bug other/54800] " dcb314 at hotmail dot com 2013-01-01 16:34 ` ian at airs dot com [this message] 2013-01-04 18:36 ` iains at gcc dot gnu.org 2013-01-04 19:00 ` ian at gcc dot gnu.org 2013-01-04 19:01 ` ian at airs dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-54800-4-5RQX1HZiOS@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).