[PATCH 1/4] Nios II: elf subdir changes, unsigned divide in ld.so

Chung-Lin Tang cltang@codesourcery.com
Fri Mar 28 15:39:00 GMT 2014


This patch contains the changes in the elf/ subdir. The main changes are:

(1) The changes to add Nios II to elf/elf.h, machine number,
relocations, etc. Pretty standard stuff copied from BFD.

(2) A change in elf/dynamic-link.h, to allow a port to define a special
unsigned integer divide during RTLD_BOOTSTRAP, by defining
RTLD_BOOTSTRAP_UDIV.

The rationale is: while Nios II does have optional hardware integer
divide defined as part of the ISA spec, the current support we're
working on here is for the common no-divider case, relying on libgcc
__udivsi3.

Unfortunately however, Nios II does not have PC-relative calls (only a
direct transfer call similar to MIPS), so all subroutine calls under PIC
have to go through the GOT, which... is not available yet during
RTLD_BOOTSTRAP.

So the RTLD_BOOTSTRAP_UDIV macro facility allows nios2 to define its own
inline udiv in dl-machine.h, for use when libgcc is still not accessible.

Thanks,
Chung-Lin

        * elf/dynamic-link.h (RTLD_UDIV): New macro.
        (elf_machine_lazy_rel): Change divide operation to use RTLD_UDIV.
        * elf/elf.h (EM_ALTERA_NIOS2): New machine number for Altera
Nios II.
        (DT_NIOS2_GP): New dynamic entry type for Nios II _gp address.
        (R_NIOS2_*): Define Nios II relocations.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 01-elf.patch
Type: text/x-patch
Size: 3652 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20140328/9dc7c3e6/attachment.bin>


More information about the Libc-alpha mailing list