aboutsummaryrefslogtreecommitdiff
path: root/xtask/src/lib.rs
diff options
context:
space:
mode:
authorGravatar Jonas Schievink <jonasschievink@gmail.com> 2020-11-04 02:10:32 +0100
committerGravatar Jonas Schievink <jonasschievink@gmail.com> 2020-11-04 02:10:32 +0100
commit577f15bc181cfb14da66a9c520aff9cd5c0fe214 (patch)
tree7059fa13a2f96c6a06270d0582902ace9255824d /xtask/src/lib.rs
parent1762486eddee0dbacaa702be3afbbae8c183f0c2 (diff)
downloadcortex-m-577f15bc181cfb14da66a9c520aff9cd5c0fe214.tar.gz
cortex-m-577f15bc181cfb14da66a9c520aff9cd5c0fe214.tar.zst
cortex-m-577f15bc181cfb14da66a9c520aff9cd5c0fe214.zip
Preserve input ELF flags
This is required for MIPS to work correctly, but not yet for Cortex-M targets.
Diffstat (limited to 'xtask/src/lib.rs')
-rw-r--r--xtask/src/lib.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/xtask/src/lib.rs b/xtask/src/lib.rs
index d1f483b..b1e982e 100644
--- a/xtask/src/lib.rs
+++ b/xtask/src/lib.rs
@@ -41,6 +41,8 @@ fn trim_panic_handler(obj_file: &str) {
let obj = object::File::parse(&objdata).unwrap();
let mut writer = Object::new(obj.format(), obj.architecture(), obj.endianness());
+ writer.flags = obj.flags(); // Preserve flags of input file
+
for (sec_index, section) in obj.sections().enumerate() {
assert_eq!(section.index().0, sec_index);