- "NAME.plt". */
- struct minimal_symbol *ptr_msym = lookup_minimal_symbol_by_pc (ptr);
-
- if (ptr_msym)
- {
- char *ptr_msym_name = SYMBOL_LINKAGE_NAME (ptr_msym);
- int len = strlen (ptr_msym_name);
-
- if (len > 4
- && strcmp (ptr_msym_name + len - 4, ".plt") == 0)
- {
- struct minimal_symbol *func_msym;
- /* We have a .plt symbol; try to find the symbol for the
- corresponding function.
-
- Since the trampoline contains a jump instruction, we
- could also just extract the jump's target address. I
- don't see much advantage one way or the other. */
- char *func_name = xmalloc (len - 4 + 1);
- memcpy (func_name, ptr_msym_name, len - 4);
- func_name[len - 4] = '\0';
- func_msym
- = lookup_minimal_symbol (func_name, NULL, NULL);
-
- /* If we do have such a symbol, return its value as the
- function's true address. */
- if (func_msym)
- ptr = SYMBOL_VALUE_ADDRESS (func_msym);
- }
- }
+ "NAME.plt". */
+ struct bound_minimal_symbol ptr_msym = lookup_minimal_symbol_by_pc (ptr);
+
+ if (ptr_msym.minsym)
+ {
+ const char *ptr_msym_name = ptr_msym.minsym->linkage_name ();
+ int len = strlen (ptr_msym_name);
+
+ if (len > 4
+ && strcmp (ptr_msym_name + len - 4, ".plt") == 0)
+ {
+ struct bound_minimal_symbol func_msym;
+ /* We have a .plt symbol; try to find the symbol for the
+ corresponding function.
+
+ Since the trampoline contains a jump instruction, we
+ could also just extract the jump's target address. I
+ don't see much advantage one way or the other. */
+ char *func_name = (char *) xmalloc (len - 4 + 1);
+ memcpy (func_name, ptr_msym_name, len - 4);
+ func_name[len - 4] = '\0';
+ func_msym
+ = lookup_minimal_symbol (func_name, NULL, NULL);
+
+ /* If we do have such a symbol, return its value as the
+ function's true address. */
+ if (func_msym.minsym)
+ ptr = BMSYMBOL_VALUE_ADDRESS (func_msym);
+ }
+ }