Merge "Do not write CFI and symbols for deduplicate methods."
diff --git a/compiler/elf_writer_debug.cc b/compiler/elf_writer_debug.cc
index 28e6999..e8c3b6e 100644
--- a/compiler/elf_writer_debug.cc
+++ b/compiler/elf_writer_debug.cc
@@ -170,11 +170,13 @@
   size_t cie_offset = eh_frame->size();
   WriteEhFrameCIE(isa, address_type, eh_frame);
   for (const OatWriter::DebugInfo& mi : method_infos) {
-    const SwapVector<uint8_t>* opcodes = mi.compiled_method_->GetCFIInfo();
-    if (opcodes != nullptr) {
-      WriteEhFrameFDE(Is64BitInstructionSet(isa), cie_offset,
-                      mi.low_pc_, mi.high_pc_ - mi.low_pc_,
-                      opcodes, eh_frame, eh_frame_patches);
+    if (!mi.deduped_) {  // Only one FDE per unique address.
+      const SwapVector<uint8_t>* opcodes = mi.compiled_method_->GetCFIInfo();
+      if (opcodes != nullptr) {
+        WriteEhFrameFDE(Is64BitInstructionSet(isa), cie_offset,
+                        mi.low_pc_, mi.high_pc_ - mi.low_pc_,
+                        opcodes, eh_frame, eh_frame_patches);
+      }
     }
   }
 
diff --git a/compiler/elf_writer_quick.cc b/compiler/elf_writer_quick.cc
index 178aa03..60f4d07 100644
--- a/compiler/elf_writer_quick.cc
+++ b/compiler/elf_writer_quick.cc
@@ -202,6 +202,9 @@
 
   auto* symtab = builder->GetSymtab();
   for (auto it = method_info.begin(); it != method_info.end(); ++it) {
+    if (it->deduped_) {
+      continue;  // Add symbol only for the first instance.
+    }
     std::string name = PrettyMethod(it->dex_method_index_, *it->dex_file_, true);
     if (deduped_addresses.find(it->low_pc_) != deduped_addresses.end()) {
       name += " [DEDUPED]";