1. Feb 22, 2019
  2. Feb 08, 2019
  3. Feb 07, 2019
  4. Feb 05, 2019
  5. Jan 27, 2019
  6. Jan 26, 2019
  7. Nov 21, 2018
  8. Aug 18, 2018
    • bors[bot]'s avatar
      Merge #10 · f20c0bd3
      bors[bot] authored
      
      
      10: support linking with lld r=dvc94ch a=danc86
      
      Rust now ships an embedded copy of lld, so if we can link crates with lld it will make the getting started experience way smoother (don't need to find a separate GNU ld).
      
      Co-authored-by: default avatarDan Callaghan <djc@djc.id.au>
      f20c0bd3
  9. Aug 15, 2018
    • Dan Callaghan's avatar
      make the linker script compatible with lld · 52095e93
      Dan Callaghan authored
      To work around a bug in lld, we need to avoid starting the .bss section
      from a fixed address (previously, the _sbss symbol). Otherwise lld
      incorrectly tries to extend the FLASH output region up to the start of
      the RAM output region, which is too large.
      
      To work around another bug in lld, we need to avoid starting sections
      marked with (INFO) from a specific starting address. Its parser does not
      accept both a start address and the (INFO) attribute.
      
      Specifying these start addresses is redundant anyway, the linker will
      lay them out in sequential order for us.
      52095e93
    • Dan Callaghan's avatar
      discard .eh_frame sections · 90966abf
      Dan Callaghan authored
      The .cfi_* assembler directives cause call frame information to be
      emitted in a special .eh_frame section. But this is not needed in the
      final binary, because we are not doing panic unwinding.
      
      GNU ld already discards this section with its (default) --gc-sections
      behaviour. Lld doesn't do that by default though, instead it complains:
      
          rust-lld: error: no memory region specified for section '.eh_frame'
      
      So let's explicitly discard the .eh_frame section.
      90966abf
    • Dan Callaghan's avatar
      align VMA not LMA · ef3a278c
      Dan Callaghan authored
      This aligns the VMA (virtual adddress at runtime):
      
          .rodata ALIGN(4) :
          {
              ...
      
      whereas this aligns the LMA (load address):
      
          .rodata : ALIGN(4)
          {
              ...
      
      If we ensure the VMA is aligned the linker will keep the corresponding
      LMA in sync (and it will be aligned too).
      
      Previously, by forcing the LMA to be aligned but leaving the VMA
      unspecified, the linker would split .text and .rodata into two
      separate loads because their addresses fell out of sync.
      ef3a278c
    • Dan Callaghan's avatar
      remove hackery for .debug_gdb_scripts section · 7451011e
      Dan Callaghan authored
      This is no longer necessary now that we can configure the target to
      exclude the .debug_gdb_scripts section.
      See: https://github.com/rust-lang/rust/pull/53139
      7451011e
    • Dan Callaghan's avatar
      mark .init and .trap sections as executable · 99841150
      Dan Callaghan authored
      This is needed for lld, otherwise it will complain about section flag
      mismatch:
      
          ld.lld: error: incompatible section flags for .text
          >>> target/riscv32imac-unknown-none/debug/deps/libriscv_rt-7850ee1a6233fbe9.rlib(riscv_rt-7850ee1a6233fbe9.4tmuw4s4crjeqbm5.rcgu.o):(.trap): 0x4
          >>> output section .text: 0x6
      99841150
  10. Aug 12, 2018
  11. Aug 10, 2018
    • Dan Callaghan's avatar
      don't declare _start_rust as a "naked" function · 12fd1250
      Dan Callaghan authored
      The #[naked] attribute means Rust won't emit instructions to push and
      pop a new stack frame. But the assembly routine which calls _start_rust
      also doesn't push a new stack frame, so there is no valid stack for this
      function.
      
      We probably need a stack frame though, since it's implemented in Rust
      and we can't easily ensure that Rust won't try to allocate any local
      variables. See #5.
      12fd1250