Skip to content

Commit 5b5b8b1

Browse files
Merge #285
285: `xtask assemble` fixes r=thalesfragoso a=jonas-schievink Closes #284 Co-authored-by: Jonas Schievink <[email protected]>
2 parents 94d3357 + 577f15b commit 5b5b8b1

16 files changed

+4
-1
lines changed

asm/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ shims! {
126126
/// handler gets linked in, this causes a linker error. We always build this file with optimizations
127127
/// enabled, but even without them the panic handler should never be linked in.
128128
#[panic_handler]
129+
#[link_section = ".text.asm_panic_handler"]
129130
fn panic(_: &core::panic::PanicInfo) -> ! {
130131
extern "C" {
131132
#[link_name = "cortex-m internal error: panic handler not optimized out, please file an \

bin/thumbv6m-none-eabi-lto.a

84 Bytes
Binary file not shown.

bin/thumbv6m-none-eabi.a

-192 Bytes
Binary file not shown.

bin/thumbv7em-none-eabi-lto.a

80 Bytes
Binary file not shown.

bin/thumbv7em-none-eabi.a

-192 Bytes
Binary file not shown.

bin/thumbv7em-none-eabihf-lto.a

84 Bytes
Binary file not shown.

bin/thumbv7em-none-eabihf.a

-192 Bytes
Binary file not shown.

bin/thumbv7m-none-eabi-lto.a

84 Bytes
Binary file not shown.

bin/thumbv7m-none-eabi.a

-192 Bytes
Binary file not shown.

bin/thumbv8m.base-none-eabi-lto.a

84 Bytes
Binary file not shown.

bin/thumbv8m.base-none-eabi.a

-196 Bytes
Binary file not shown.

bin/thumbv8m.main-none-eabi-lto.a

80 Bytes
Binary file not shown.

bin/thumbv8m.main-none-eabi.a

-196 Bytes
Binary file not shown.

bin/thumbv8m.main-none-eabihf-lto.a

84 Bytes
Binary file not shown.

bin/thumbv8m.main-none-eabihf.a

-196 Bytes
Binary file not shown.

xtask/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,15 @@ fn trim_panic_handler(obj_file: &str) {
4141
let obj = object::File::parse(&objdata).unwrap();
4242

4343
let mut writer = Object::new(obj.format(), obj.architecture(), obj.endianness());
44+
writer.flags = obj.flags(); // Preserve flags of input file
45+
4446
for (sec_index, section) in obj.sections().enumerate() {
4547
assert_eq!(section.index().0, sec_index);
4648

4749
let name = section.name().unwrap();
4850
if name.starts_with(".ARM")
4951
|| name.starts_with(".rel.ARM")
50-
|| name.contains("cortex_m_asm_panic")
52+
|| name.contains("asm_panic_handler")
5153
|| name == ".strtab"
5254
|| name == ".symtab"
5355
{

0 commit comments

Comments
 (0)