Page MenuHomePhabricator

Only check for _ZN function prefix in Linux and FreeBSD targets in SymbolFileDWARF
ClosedPublic

Authored by flackr on May 14 2015, 2:03 PM.

Details

Summary

In http://reviews.llvm.org/D9754 I enabled the mangled symbol name lookup workaround used to find global and anonymous namespace symbols in linux binaries for all platforms, however we should still only check for these symbols when processing Linux or FreeBSD binaries where they are relevant. This patch makes this change.

Diff Detail

Repository
rL LLVM

Event Timeline

flackr updated this revision to Diff 25809.May 14 2015, 2:03 PM
flackr retitled this revision from to Only check for _ZN function prefix in Linux and FreeBSD targets in SymbolFileDWARF.
flackr updated this object.
flackr edited the test plan for this revision. (Show Details)
flackr added a reviewer: zturner.
flackr set the repository for this revision to rL LLVM.
flackr added a subscriber: Unknown Object (MLST).
ted added a subscriber: ted.May 14 2015, 3:26 PM

This codepath also fixes mangling issues with Hexagon binaries. Please add

|| (arch.GetTriple().GetMachine() == llvm::Triple::hexagon)

to the if, to pick up the fix for Hexagon.

You also might want to move

SymbolContextList temp_sc_list;
FindFunctions (name, m_function_basename_index, include_inlines, temp_sc_list);

inside the if so extra code isn't run unecessarily.

I don't think it's a (Linux or FreeBSD) issue; I think it's a ((clang or gcc) and not Darwin) issue.

flackr updated this revision to Diff 25838.May 14 2015, 7:00 PM
  • Check for hexagon machine.
  • Added comment to fix object arch on Windows and detect global / anonymous namespace symbols there.

zturner, I added a comment about Windows like you suggested.

In D9782#173178, @ted wrote:

This codepath also fixes mangling issues with Hexagon binaries. Please add

|| (arch.GetTriple().GetMachine() == llvm::Triple::hexagon)

to the if, to pick up the fix for Hexagon.

Done.

You also might want to move

SymbolContextList temp_sc_list;
FindFunctions (name, m_function_basename_index, include_inlines, temp_sc_list);

inside the if so extra code isn't run unecessarily.

Done.

I don't think it's a (Linux or FreeBSD) issue; I think it's a ((clang or gcc) and not Darwin) issue.

zturner accepted this revision.May 15 2015, 11:50 AM
zturner edited edge metadata.

looks good

This revision is now accepted and ready to land.May 15 2015, 11:50 AM
This revision was automatically updated to reflect the committed changes.