Skip to content

Commit 0909080

Browse files
committed
Add readelf support to run-make-support
1 parent d5b34a2 commit 0909080

File tree

1 file changed

+23
-0
lines changed
  • src/tools/run-make-support/src

1 file changed

+23
-0
lines changed

src/tools/run-make-support/src/llvm.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,22 @@ impl LlvmReadobj {
6161
Self { cmd }
6262
}
6363

64+
/// Specify the format of the ELF information.
65+
///
66+
/// Valid options are `LLVM` (default), `GNU`, and `JSON`.
67+
pub fn elf_output_style(&mut self, style: &str) -> &mut Self {
68+
self.cmd.arg("--elf-output-style");
69+
self.cmd.arg(style);
70+
self
71+
}
72+
73+
/// Set the formation of the ELF information as `GNU`.
74+
///
75+
/// Convenience function for [`elf_output_style`].
76+
pub fn gnu_elf_style(&mut self) -> &mut Self {
77+
self.elf_output_style("GNU")
78+
}
79+
6480
/// Provide an input file.
6581
pub fn input<P: AsRef<Path>>(&mut self, path: P) -> &mut Self {
6682
self.cmd.arg(path.as_ref());
@@ -72,6 +88,13 @@ impl LlvmReadobj {
7288
self.cmd.arg("--file-header");
7389
self
7490
}
91+
92+
/// Specify the section to display.
93+
pub fn section(&mut self, section: &str) -> &mut Self {
94+
self.cmd.arg("--string-dump");
95+
self.cmd.arg(section);
96+
self
97+
}
7598
}
7699

77100
impl LlvmProfdata {

0 commit comments

Comments
 (0)