Ignore:
Timestamp:
2023-01-18T20:20:29Z (23 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b67ce1ff
Parents:
b83c5e4
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2022-09-02 18:43:01)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-01-18 20:20:29)
Message:

Fix handling of ABS32 relocation on arm32

A bad symbol reference in entryjmp.S was creating
an ABS32 relocation causing issues for dynamic
linker, leading to the ABS32 relocation being
generally ignored. However, that was not the
correct solution, as doing so breaks stacktrace
code (which emits global function pointers in
static data, creating ABS32 relocs).

The symbol reference in entryjmp.S was fixed by
converting the function to inline assembly, let
GCC deal with variable addresses.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/arch/arm32/src/rtld/reloc.c

    rb83c5e4 reb630cf  
    127127
    128128                switch (rel_type) {
    129                 case R_ARM_ABS32:
    130                         DPRINTF("ignore R_ARM_ABS32\n");
    131                         /*
    132                          * Not sure why we get these static relocations, but
    133                          * attempting to process them will crash the
    134                          * loader. If we ignore them, everything
    135                          * seems to work.
    136                          */
    137                         break;
    138 
    139129                case R_ARM_TLS_DTPMOD32:
    140130                        DPRINTF("fixup R_ARM_TLS_DTPMOD32\n");
     
    189179                case R_ARM_GLOB_DAT:
    190180                case R_ARM_JUMP_SLOT:
    191                         DPRINTF("fixup R_ARM_GLOB_DAT/JUMP_SLOT (S)\n");
     181                case R_ARM_ABS32:
     182                        DPRINTF("fixup R_ARM_GLOB_DAT/JUMP_SLOT/ABS32 (S)\n");
    192183                        *r_ptr = sym_addr;
    193184                        break;
Note: See TracChangeset for help on using the changeset viewer.