Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 3ffb69b in mainline


Ignore:
Timestamp:
2019-01-22T12:16:42Z (2 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
b51ee38
Parents:
e5360a8
git-author:
Jiri Svoboda <jiri@…> (2019-01-21 18:16:32)
git-committer:
Jiri Svoboda <jiri@…> (2019-01-22 12:16:42)
Message:

Dynamic linking for arm32

Files:
5 added
8 edited

Legend:

Unmodified
Added
Removed
  • HelenOS.config

    re5360a8 r3ffb69b  
    578578
    579579% Dynamic linking support
    580 ! [PLATFORM=amd64|PLATFORM=ia32|PLATFORM=ppc32|PLATFORM=sparc64] CONFIG_RTLD (y/n)
    581 ! [PLATFORM=abs32le|PLATFORM=arm32|PLATFORM=ia64|PLATFORM=mips32|PLATFORM=riscv64] CONFIG_RTLD (n)
     580! [PLATFORM=amd64|PLATFORM=arm32|PLATFORM=ia32|PLATFORM=ppc32|PLATFORM=sparc64] CONFIG_RTLD (y/n)
     581! [PLATFORM=abs32le|PLATFORM=ia64|PLATFORM=mips32|PLATFORM=riscv64] CONFIG_RTLD (n)
    582582
    583583% Build shared libraries
  • defaults/arm32/Makefile.config

    re5360a8 r3ffb69b  
    3838CONFIG_HID_OUT = generic
    3939
     40# Dynamic linking support
     41CONFIG_RTLD = y
     42
     43# Build shared libraries
     44CONFIG_BUILD_SHARED_LIBS = y
     45
     46# Link against shared libraries
     47CONFIG_USE_SHARED_LIBS = y
     48
    4049# Optimization level
    4150OPTIMIZATION = 3
  • uspace/lib/c/arch/arm32/Makefile.common

    re5360a8 r3ffb69b  
    2929
    3030COMMON_CFLAGS += -ffixed-r9 -mtp=soft -fno-omit-frame-pointer -mapcs-frame \
    31         -mcpu=$(subst _,-,$(PROCESSOR))
     31        -mcpu=$(subst _,-,$(PROCESSOR)) -Wl,-z,max-page-size=0x1000
    3232
    3333LDFLAGS += -Wl,--gc-sections
  • uspace/lib/c/arch/arm32/Makefile.inc

    re5360a8 r3ffb69b  
    3737        arch/$(UARCH)/src/eabi.S \
    3838        arch/$(UARCH)/src/stacktrace.c \
    39         arch/$(UARCH)/src/stacktrace_asm.S
     39        arch/$(UARCH)/src/stacktrace_asm.S \
     40        arch/$(UARCH)/src/rtld/dynamic.c \
     41        arch/$(UARCH)/src/rtld/reloc.c
  • uspace/lib/c/arch/arm32/include/libarch/tls.h

    re5360a8 r3ffb69b  
    4949 */
    5050typedef struct {
     51        void **dtv;
     52        void *pad;
    5153        /** Fibril data. */
    5254        void *fibril_data;
  • uspace/lib/c/arch/arm32/src/atomic.c

    re5360a8 r3ffb69b  
    3535#include <stdbool.h>
    3636
    37 extern volatile unsigned *ras_page;
     37volatile unsigned *ras_page;
    3838
    3939bool __atomic_compare_exchange_4(volatile unsigned *mem, unsigned *expected, unsigned desired, bool weak, int success, int failure)
  • uspace/lib/c/arch/arm32/src/entry.S

    re5360a8 r3ffb69b  
    5757.data
    5858
    59 SYMBOL(ras_page)
    60         .long 0
     59# SYMBOL(ras_page)
     60#       .long 0
  • uspace/lib/c/arch/arm32/src/tls.c

    re5360a8 r3ffb69b  
    11/*
     2 * Copyright (c) 2019 Jiri Svoboda
    23 * Copyright (c) 2007 Pavel Jancik
    34 * All rights reserved.
     
    3839#include <stddef.h>
    3940
     41#ifdef CONFIG_RTLD
     42#include <rtld/rtld.h>
     43#endif
     44
    4045tcb_t *tls_alloc_arch(size_t size, size_t align)
    4146{
     
    4853}
    4954
     55/*
     56 * Rtld TLS support
     57 */
     58
     59typedef struct {
     60        unsigned long int ti_module;
     61        unsigned long int ti_offset;
     62} tls_index;
     63
     64int __tls_debug = 0;
     65
     66void *__tls_get_addr(tls_index *ti);
     67
     68void *__tls_get_addr(tls_index *ti)
     69{
     70        uint8_t *tls;
     71
     72#ifdef CONFIG_RTLD
     73        if (runtime_env != NULL) {
     74                return rtld_tls_get_addr(runtime_env, __tcb_get(),
     75                    ti->ti_module, ti->ti_offset);
     76        }
     77#endif
     78        /* Get address of static TLS block */
     79        tls = tls_get();
     80        return tls + ti->ti_offset;
     81}
     82
    5083/** @}
    5184 */
Note: See TracChangeset for help on using the changeset viewer.