File tree 4 files changed +27
-0
lines changed
4 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,18 @@ section size addr
139
139
Total 0x531a
140
140
```
141
141
142
+ ### ` strip `
143
+
144
+ ``` console
145
+ $ stat --printf=" %s\n" target/release/hello
146
+ 2120128
147
+
148
+ $ cargo-strip -- target/release/hello
149
+
150
+ $ stat --printf=" %s\n" target/release/hello
151
+ 408048
152
+ ```
153
+
142
154
## License
143
155
144
156
Licensed under either of
Original file line number Diff line number Diff line change 8
8
cargo objdump -v -- -d target/release/cargo-objdump > /dev/null
9
9
cargo objcopy -v -- -O binary target/release/cargo-objdump objdump.bin > /dev/null
10
10
cargo size -v -- target/release/cargo-size
11
+ cargo strip -v -- target/release/cargo-strip
11
12
}
12
13
13
14
main
Original file line number Diff line number Diff line change
1
+ extern crate cargo_binutils as cbu;
2
+
3
+ use std:: process;
4
+
5
+ fn main ( ) {
6
+ match cbu:: run ( |ctxt| ctxt. strip ( ) , false ) {
7
+ Err ( e) => eprintln ! ( "error: {}" , e) ,
8
+ Ok ( ec) => process:: exit ( ec) ,
9
+ }
10
+ }
Original file line number Diff line number Diff line change @@ -163,6 +163,10 @@ impl Context {
163
163
self . tool ( "llvm-size" )
164
164
}
165
165
166
+ pub fn strip ( & self ) -> Command {
167
+ self . tool ( "llvm-strip" )
168
+ }
169
+
166
170
pub fn tool_args ( & self ) -> & [ String ] {
167
171
& self . tool_args
168
172
}
You can’t perform that action at this time.
0 commit comments