Skip to content

link_section attribute seems to be broken #27467

@ababo

Description

@ababo

I compile the code below:

#[link_section = ".multiboot_header"]
pub static MULTIBOOT_HEADER: multiboot::Header = multiboot::Header {
    magic: multiboot::HEADER_MAGIC,
    flags: HEADER_FLAGS,
    checksum: (-((multiboot::HEADER_MAGIC + HEADER_FLAGS) as i32) as u32),
    header_addr: 0,
    load_addr: 0,
    load_end_addr: 0,
    bss_end_addr: 0,
    entry_addr: 0,
    mode_type: 0,
    width: 0,
    height: 0,
    depth: 0
};

using compiler version 1.3.0-nightly (922aef0 2015-07-27) with the following command line:

rustc --crate-type rlib --target x86_64-unknown-linux-gnu -C opt-level=3 -C no-stack-check -Z no-landing-pads --cfg arch_x86_64 --sysroot /dev/null ...

As result I get the following symbol inside a produced rlib:

0000000000000000 g O .rodata._ZN4arch4boot16MULTIBOOT_HEADER20h86b23e12a2a05e14jaaE 0000000000000030 arch:: boot ::MULTIBOOT_HEADER::h86b23e12a2a05e14jaa

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions