Re: [PATCH v2 5/5] T360-symbol-hiding: Use nm instead of objdump.
authorCharles Celerier <cceleri@cs.stanford.edu>
Thu, 8 May 2014 15:03:05 +0000 (11:03 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:02:23 +0000 (10:02 -0800)
b0/583381723cda4a7e13bbb80453065d5dd91181 [new file with mode: 0644]

diff --git a/b0/583381723cda4a7e13bbb80453065d5dd91181 b/b0/583381723cda4a7e13bbb80453065d5dd91181
new file mode 100644 (file)
index 0000000..f7295a7
--- /dev/null
@@ -0,0 +1,243 @@
+Return-Path: <cceleri@cs.stanford.edu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 1BD68431FBF\r
+       for <notmuch@notmuchmail.org>; Thu,  8 May 2014 08:03:17 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 5xsryG0rPHXZ for <notmuch@notmuchmail.org>;\r
+       Thu,  8 May 2014 08:03:09 -0700 (PDT)\r
+Received: from smtp2.cs.Stanford.EDU (smtp2.cs.Stanford.EDU [171.64.64.26])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id AC414431FAE\r
+       for <notmuch@notmuchmail.org>; Thu,  8 May 2014 08:03:09 -0700 (PDT)\r
+Received: from c-24-11-133-78.hsd1.sc.comcast.net ([24.11.133.78]\r
+       helo=jane.lan)\r
+       by smtp2.cs.Stanford.EDU with esmtpsa (UNKNOWN:AES128-GCM-SHA256:128)\r
+       (Exim 4.80.1) (envelope-from <cceleri@cs.stanford.edu>)\r
+       id 1WiPql-0001Zl-QJ; Thu, 08 May 2014 08:03:08 -0700\r
+From: Charles Celerier <cceleri@cs.stanford.edu>\r
+To: David Bremner <david@tethera.net>, Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: Re: [PATCH v2 5/5] T360-symbol-hiding: Use nm instead of objdump.\r
+In-Reply-To: <87d2fov2qj.fsf@maritornes.cs.unb.ca>\r
+References: <1399395748-44920-1-git-send-email-cceleri@cs.stanford.edu>\r
+       <1399434615-28425-1-git-send-email-cceleri@cs.stanford.edu>\r
+       <1399434615-28425-2-git-send-email-cceleri@cs.stanford.edu>\r
+       <87d2fov2qj.fsf@maritornes.cs.unb.ca>\r
+User-Agent: Notmuch/0.18~rc0+32~gd5092c2 (http://notmuchmail.org) Emacs/24.3.1\r
+       (x86_64-apple-darwin13.1.0)\r
+Date: Thu, 08 May 2014 11:03:05 -0400\r
+Message-ID: <m2zjisnwie.fsf@jane.lan>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="=-=-=";\r
+       micalg=pgp-sha1; protocol="application/pgp-signature"\r
+X-Scan-Signature: 1d850ab87a3e5a2ab763966491000bbf\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 08 May 2014 15:03:17 -0000\r
+\r
+--=-=-=\r
+Content-Type: text/plain\r
+\r
+David Bremner <david@tethera.net> writes:\r
+\r
+> Charles Celerier <cceleri@cs.stanford.edu> writes:\r
+>>  test_begin_subtest 'comparing existing to exported symbols'\r
+>> -objdump -t $TEST_DIRECTORY/../lib/*.o | awk '$4 == ".text" && $6 ~ "^notmuch" {print $6}' | sort | uniq > ACTUAL\r
+>> +nm -g $TEST_DIRECTORY/../lib/*.o | sed -n 's/.*\s\+T\s\+_\(notmuch_.*\)/\1/p' | sort | uniq > ACTUAL\r
+>>  sed -n 's/[[:blank:]]*\(notmuch_[^;]*\);/\1/p' $TEST_DIRECTORY/../notmuch.sym | sort | uniq > EXPORTED\r
+>\r
+> Hmm. It seems like the _ there is wrong. It grabs all of the symbols\r
+> starting with _notmuch, which are symbols we _don't_ want exported.\r
+> It makes me wonder what ends up in "notmuch.sym" on MacOS, if that test\r
+> passes for you.\r
+\r
+Ok. Apologies in advance for the verbose content of this email. Here is my notmuch.sym:\r
+\r
+    $ cat notmuch.sym\r
+    {\r
+    global:\r
+       __ZTIN6Xapian10LogicErrorE;\r
+       __ZTIN6Xapian12RuntimeErrorE;\r
+       __ZTIN6Xapian16DocNotFoundErrorE;\r
+       __ZTIN6Xapian20InvalidArgumentErrorE;\r
+       __ZTIN6Xapian5ErrorE;\r
+       __ZTSN6Xapian10LogicErrorE;\r
+       __ZTSN6Xapian12RuntimeErrorE;\r
+       __ZTSN6Xapian16DocNotFoundErrorE;\r
+       __ZTSN6Xapian20InvalidArgumentErrorE;\r
+       __ZTSN6Xapian5ErrorE;\r
+     notmuch_status_to_string;\r
+     notmuch_database_create;\r
+     notmuch_database_open;\r
+     notmuch_database_close;\r
+     notmuch_database_compact;\r
+     notmuch_database_destroy;\r
+     notmuch_database_get_path;\r
+     notmuch_database_get_version;\r
+     notmuch_database_needs_upgrade;\r
+     notmuch_database_upgrade;\r
+     notmuch_database_begin_atomic;\r
+     notmuch_database_end_atomic;\r
+     notmuch_database_get_directory;\r
+     notmuch_database_add_message;\r
+     notmuch_database_remove_message;\r
+     notmuch_database_find_message;\r
+     notmuch_database_find_message_by_filename;\r
+     notmuch_database_get_all_tags;\r
+     notmuch_query_create;\r
+     notmuch_query_get_query_string;\r
+     notmuch_query_set_omit_excluded;\r
+     notmuch_query_set_sort;\r
+     notmuch_query_get_sort;\r
+     notmuch_query_add_tag_exclude;\r
+     notmuch_query_search_threads;\r
+     notmuch_query_search_messages;\r
+     notmuch_query_destroy;\r
+     notmuch_threads_valid;\r
+     notmuch_threads_get;\r
+     notmuch_threads_move_to_next;\r
+     notmuch_threads_destroy;\r
+     notmuch_query_count_messages;\r
+     notmuch_query_count_threads;\r
+     notmuch_thread_get_thread_id;\r
+     notmuch_thread_get_total_messages;\r
+     notmuch_thread_get_toplevel_messages;\r
+     notmuch_thread_get_messages;\r
+     notmuch_thread_get_matched_messages;\r
+     notmuch_thread_get_authors;\r
+     notmuch_thread_get_subject;\r
+     notmuch_thread_get_oldest_date;\r
+     notmuch_thread_get_newest_date;\r
+     notmuch_thread_get_tags;\r
+     notmuch_thread_destroy;\r
+     notmuch_messages_valid;\r
+     notmuch_messages_get;\r
+     notmuch_messages_move_to_next;\r
+     notmuch_messages_destroy;\r
+     notmuch_messages_collect_tags;\r
+     notmuch_message_get_message_id;\r
+     notmuch_message_get_thread_id;\r
+     notmuch_message_get_replies;\r
+     notmuch_message_get_filename;\r
+     notmuch_message_get_filenames;\r
+     notmuch_message_get_flag;\r
+     notmuch_message_set_flag;\r
+     notmuch_message_get_date;\r
+     notmuch_message_get_header;\r
+     notmuch_message_get_tags;\r
+     notmuch_message_add_tag;\r
+     notmuch_message_remove_tag;\r
+     notmuch_message_remove_all_tags;\r
+     notmuch_message_maildir_flags_to_tags;\r
+     notmuch_message_tags_to_maildir_flags;\r
+     notmuch_message_freeze;\r
+     notmuch_message_thaw;\r
+     notmuch_message_destroy;\r
+     notmuch_tags_valid;\r
+     notmuch_tags_get;\r
+     notmuch_tags_move_to_next;\r
+     notmuch_tags_destroy;\r
+     notmuch_directory_set_mtime;\r
+     notmuch_directory_get_mtime;\r
+     notmuch_directory_get_child_files;\r
+     notmuch_directory_get_child_directories;\r
+     notmuch_directory_destroy;\r
+     notmuch_filenames_valid;\r
+     notmuch_filenames_get;\r
+     notmuch_filenames_move_to_next;\r
+     notmuch_filenames_destroy;\r
+    local: *;\r
+    };\r
+\r
+The output of the test in question (T360-symbol-hiding) after\r
+applying all of the patches in this series is\r
+\r
+    T360-symbol-hiding: Testing exception symbol hiding\r
+     PASS   running test\r
+     PASS   checking output\r
+     FAIL   comparing existing to exported symbols\r
+       --- T360-symbol-hiding.3.EXPORTED   2014-05-08\r
+     14:48:52.000000000 +0000\r
+       +++ T360-symbol-hiding.3.ACTUAL 2014-05-08 14:48:52.000000000\r
+     +0000\r
+       @@ -26,7 +26,11 @@\r
+        notmuch_filenames_valid\r
+        notmuch_message_add_tag\r
+        notmuch_message_destroy\r
+       +notmuch_message_file_close\r
+       +notmuch_message_file_get_header\r
+       +notmuch_message_file_open\r
+        notmuch_message_freeze\r
+       +notmuch_message_get_author\r
+        notmuch_message_get_date\r
+        notmuch_message_get_filename\r
+        notmuch_message_get_filenames\r
+       @@ -39,6 +43,7 @@\r
+        notmuch_message_maildir_flags_to_tags\r
+        notmuch_message_remove_all_tags\r
+        notmuch_message_remove_tag\r
+       +notmuch_message_set_author\r
+        notmuch_message_set_flag\r
+        notmuch_message_tags_to_maildir_flags\r
+        notmuch_message_thaw\r
+       @@ -58,6 +63,8 @@\r
+        notmuch_query_search_threads\r
+        notmuch_query_set_omit_excluded\r
+        notmuch_query_set_sort\r
+       +notmuch_sha1_of_file\r
+       +notmuch_sha1_of_string\r
+        notmuch_status_to_string\r
+        notmuch_tags_destroy\r
+        notmuch_tags_get\r
+\r
+This output was a clear motivation for the patch in\r
+id:1399402716-13714-1-git-send-email-cceleri@cs.stanford.edu.\r
+\r
+Here is some of output of the matches made on the output of nm:\r
+\r
+    $ nm -g test/../lib/*.o | sed -n '/.*\s\+T\s\+_\(notmuch_.*\)/p'\r
+    00000000000028c0 T _notmuch_database_add_message\r
+    0000000000002280 T _notmuch_database_begin_atomic\r
+    0000000000001af0 T _notmuch_database_close\r
+    0000000000001de0 T _notmuch_database_compact\r
+    0000000000000300 T _notmuch_database_create\r
+    0000000000001db0 T _notmuch_database_destroy\r
+    0000000000002300 T _notmuch_database_end_atomic\r
+    ...\r
+\r
+chuck\r
+\r
+--=-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG/MacGPG2 v2.0.22 (Darwin)\r
+\r
+iQEcBAEBAgAGBQJTa5ypAAoJEOjk698fDjuARSgIAIPEtOaujQVdM7QeM3CEBCk4\r
+xZpJ2macyLr6xR/b5PoE8fPiM48nortR33TJhU1+me9SEXBUSjR5qbZvUQfek5O9\r
+dy2CKnVP+r9Iv0crfTMkK9Kklf56/9OSn8mFwVwe2hHwZcvkrqR/x46EYAntO0S7\r
+g9Xg3E4MhH4/EvWdpLI4HOcnWbc4Srzhd07z+P8OgOoYXRQ63mYLJs90B0UqXtUd\r
+Z2OxNZb/eYKwXplkqV8hxM1927+ne1pfQx1RwkZ1fLXJDFrp4vTjW7F6ciDf40ly\r
+0KAd5on/BSzYZsDamgFjzLjiZK7wGVo3Q/KO6ILeKLW3A942DEN5NnywgZqJD8A=\r
+=ErPe\r
+-----END PGP SIGNATURE-----\r
+--=-=-=--\r