MIPS: Keep the ISA bit in compressed code addresses
[deliverable/binutils-gdb.git] / gdb / solib.c
index ce9dc05f9ada9911b71f2037e8c6c27a354a9350..4b4386ccf2a90432b9da24112b3d33cf47257a03 100644 (file)
@@ -1443,8 +1443,28 @@ gdb_bfd_lookup_symbol_from_symtab (bfd *abfd,
 
          if (match_sym (sym, data))
            {
+             struct gdbarch *gdbarch = target_gdbarch ();
+             symaddr = sym->value;
+
+             /* Some ELF targets fiddle with addresses of symbols they
+                consider special.  They use minimal symbols to do that
+                and this is needed for correct breakpoint placement,
+                but we do not have full data here to build a complete
+                minimal symbol, so just set the address and let the
+                targets cope with that.  */
+             if (bfd_get_flavour (abfd) == bfd_target_elf_flavour
+                 && gdbarch_elf_make_msymbol_special_p (gdbarch))
+               {
+                 struct minimal_symbol msym;
+
+                 memset (&msym, 0, sizeof (msym));
+                 SET_MSYMBOL_VALUE_ADDRESS (&msym, symaddr);
+                 gdbarch_elf_make_msymbol_special (gdbarch, sym, &msym);
+                 symaddr = MSYMBOL_VALUE_RAW_ADDRESS (&msym);
+               }
+
              /* BFD symbols are section relative.  */
-             symaddr = sym->value + sym->section->vma;
+             symaddr += sym->section->vma;
              break;
            }
        }
This page took 0.035966 seconds and 4 git commands to generate.