Skip to content

Commit

Permalink
Merge pull request #1157 from netbsduser/m68k-static
Browse files Browse the repository at this point in the history
  • Loading branch information
64 authored Oct 14, 2024
2 parents e5ab5cf + 860f911 commit ac64890
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions options/lsb/generic/tls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#include <mlibc/thread.hpp>
#include <mlibc/rtld-abi.hpp>

#if defined(__riscv) && defined(MLIBC_STATIC_BUILD)
// On RISC-V, linker optimisation is not guaranteed and so we may still get
// calls to this function in statically linked binaries.
#if (defined(__riscv) || defined(__m68k__)) && defined(MLIBC_STATIC_BUILD)
// On RISC-V and m68k, linker optimisation is not guaranteed and so we may
// still get calls to this function in statically linked binaries.
// TODO: This will break dlopen calls from statically linked programs.
extern "C" void *__tls_get_addr(struct __abi_tls_entry *entry) {
Tcb *tcbPtr = mlibc::get_current_tcb();
Expand Down
3 changes: 2 additions & 1 deletion sysdeps/linux/m68k/crt-src/Scrt1.S
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@

_start:
suba.l %fp, %fp
move.l %sp, %d0
lea _GLOBAL_OFFSET_TABLE_@GOTPC (%pc), %a5
move.l main@GOT(%a5), -(%sp)
move.l %sp, -(%sp)
move.l %d0, -(%sp)
jbsr __mlibc_entry@PLTPC

.section .note.GNU-stack,"",%progbits
3 changes: 2 additions & 1 deletion sysdeps/linux/m68k/crt-src/crt1.S
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@

_start:
suba.l %fp, %fp
move.l %sp, %d0
move.l #main, -(%sp)
move.l %sp, -(%sp)
move.l %d0, -(%sp)
jsr __mlibc_entry

.section .note.GNU-stack,"",%progbits

0 comments on commit ac64890

Please sign in to comment.