From 7cc9be9c5ac49ca0a0d6ca3905ffb5e3e58f0e9a Mon Sep 17 00:00:00 2001
From: Johan Tibell <johan.tibell@gmail.com>
Date: Wed, 27 Apr 2011 14:43:51 +0200
Subject: [PATCH] Output ELF .size directives for functions
This allows tools like Linux's perf events to display symbol names for
CMM primops.
---
compiler/nativeGen/X86/Ppr.hs | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/compiler/nativeGen/X86/Ppr.hs b/compiler/nativeGen/X86/Ppr.hs
index 5fe78e1..f8f4cc1 100644
|
a
|
b
|
|
| 87 | 87 | <+> pprCLabel_asm (mkDeadStripPreventer $ entryLblToInfoLbl lbl) |
| 88 | 88 | else empty |
| 89 | 89 | #endif |
| | 90 | $$ pprSizeDecl (if null info then lbl else entryLblToInfoLbl lbl) |
| 90 | 91 | |
| | 92 | -- | Output the ELF .size directive. |
| | 93 | pprSizeDecl :: CLabel -> Doc |
| | 94 | #if elf_OBJ_FORMAT |
| | 95 | pprSizeDecl lbl = |
| | 96 | ptext (sLit "\t.size") <+> pprCLabel_asm lbl |
| | 97 | <> ptext (sLit ", .-") <> pprCLabel_asm lbl |
| | 98 | #else |
| | 99 | pprSizeDecl _ = empty |
| | 100 | #endif |
| 91 | 101 | |
| 92 | 102 | pprBasicBlock :: NatBasicBlock Instr -> Doc |
| 93 | 103 | pprBasicBlock (BasicBlock blockid instrs) = |