Skip to content

Commit 8447ac9

Browse files
author
Junghee Lim
committed
Fix the comments in shouldSkipForwardedSymbol
1 parent db1059e commit 8447ac9

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

src/gtirb_pprinter/Mips32PrettyPrinter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,8 @@ bool Mips32PrettyPrinter::shouldSkipForwardedSymbol(
390390
// This can leave references to labels in sections that are skipped by
391391
// policy (such as `.dtors`), resulting in dangling references.
392392
//
393-
// For example, in examples/ex_dyn_library, `__do_global_dtors_auxis` resides
394-
// in the `.text` section and is one of the functions to skip.
393+
// For example, in ddisasm's examples/ex_dyn_library, `__do_global_dtors_aux`
394+
// resides in the `.text` section and is one of the functions to skip.
395395
// In the stripped binary, both the function and its reference to the
396396
// `.dtors` section remain, but `.dtors` itself is skipped by policy.
397397
//

src/gtirb_pprinter/PrettyPrinter.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -604,16 +604,14 @@ bool PrettyPrinterBase::shouldSkipForwardedSymbol(
604604
// By default, only the forwarded symbol name is checked against
605605
// skip.Symbols, without further verifying the corresponding function
606606
// or section.
607-
// This check is necessary because forwarded symbols in the PLT section
608-
// should not be skipped.
609-
// For example, in example/ex_exceptions1 built with clang,
607+
// This check is necessary because forwarded symbols generally should not
608+
// be skipped, though see Mips32PrettyPrinter for an exception. For an
609+
// example of a symbol that should not be skipped despite having a real
610+
// referent that is, see example/ex_exception1 in ddisasm: With clang, the
610611
// the PLT entry for `_ZNSt8ios_base4InitD1Ev` has a GLOBAL symbol with
611-
// the same name, which prevents a ProxyBlock from being created for that
612-
// symbol. Since the symbol already has a CodeBlock in the PLT, it would
612+
// the same name, so ddisasm creates one symbol referring to the PLT block.
613+
// Since the symbol already has a CodeBlock in the PLT, it would
613614
// be skipped if an additional section check were performed.
614-
// NOTE: If the symbol in the PLT were renamed to
615-
// `_ZNSt8ios_base4InitD1Ev_copy`, similar to how ABI-intrinsic variables
616-
// are handled, this CheckSymNameOnly would no longer be necessary.
617615
bool CheckSymNameOnly = true;
618616
return shouldSkip(Policy, ForwardedSymbol, CheckSymNameOnly);
619617
}

0 commit comments

Comments
 (0)