Changeset ae84e38 in mainline


Ignore:
Timestamp:
2018-04-10T18:51:14Z (6 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ad0d1f5
Parents:
20287223
Message:

Remove _gp from sparc linker script.

The global pointer is set by each PIC function individually,
so the value loaded to %l7 here is never used.
Especially if libc is shared library, since then the GOT
of main has a different address than the GOT of the main
executable (if there even is one).

Location:
uspace/lib/c/arch/sparc64
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/arch/sparc64/_link.ld.in

    r20287223 rae84e38  
    2828
    2929        .got : {
    30                  _gp = .;
    3130                 *(.got*);
    3231        } :data
  • uspace/lib/c/arch/sparc64/src/entry.S

    r20287223 rae84e38  
    4747
    4848        # Pass pcb_ptr as the first argument to __main()
     49        call __main
    4950        mov %i1, %o0
    50         sethi %hi(_gp), %l7
    51         call __main
    52         or %l7, %lo(_gp), %l7
  • uspace/lib/c/arch/sparc64/src/thread_entry.S

    r20287223 rae84e38  
    4545        # Propagate the input arguments to the new window.
    4646        #
     47
     48        call __thread_main              ! %o0 contains address of uarg
    4749        mov %i0, %o0
    4850
    49         sethi %hi(_gp), %l7
    50         call __thread_main              ! %o0 contains address of uarg
    51         or %l7, %lo(_gp), %l7
    52 
    5351        ! not reached
Note: See TracChangeset for help on using the changeset viewer.