Giter Club home page Giter Club logo

min-dl's Introduction

min-dl: minimal dynamic linker implementation

To support dynamic linking, each ELF shared libary and each executable that uses shared libraries has a Procedure Linkage Table (PLT), which adds a level of indirection for function calls analogous to that provided by the GOT for data. The PLT also permits "lazy evaluation", that is, not resolving procedure addresses until they are called for the first time.

Since the PLT tends to have a lot more entries than the GOT, and most of the routines will never be called in any given program, that can both speed startup and save considerable time overall.

min-dl introduces a straightforward way to load the specified shared objects and then perform the necessary relocations, including the shared objects that the target shared object uses.

Licensing

min-dl is freely redistributable under the two-clause BSD License. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

min-dl's People

Contributors

jserv avatar lecopzer avatar slashlife avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

min-dl's Issues

Insecure memory access permission to .text section in ARM

In lib-support.h

asm(".pushsection .text,\"ax\", \"progbits\""    "\n" \
        "slowpath_common:"                              "\n" \
        PUSH(plt_handle, REG_IP)                   "\n" \

after expanding PUSH() in ARM

ldr r3, =plt_handle  
ldr r2, [r3] 
push {r2}

and ldr r3, =plt_handle will be assembled as

2ec: e59f3070  ldr r3, [pc, #112]  ; 364 <test_import1+0x18>
364: 00011034  .word 0x00011034

The problem is:
364: 00011034 .word 0x00011034 will appear in .rel.dyn that we must relocate the offset of 364.
BUT the offset of 364 locates in .text.

So we have to give WRITE permission to make .text relocatable during mmap().

.text section must have only READ and EXECUTE permission.

iov_int_string may fail for INT_MIN

When attempting to print INT_MIN on a system using twos-complement representation, -INT_MIN will result in INT_MIN, applying negative indices to the digit lookup array, resulting in out-of-bounds access and undefined behavior.

no native symbol resolution support

why cant it resolve symbols natively like libdl/dynamic loader does, as using a pre built somwhat symbol tablish thing in a library would defeat the point of using this is a possible dynamic loader since there is NO garentee that the table required is in other libs, especily in the same mannor as done in test_lib.c

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.