RTEMS: cpukit/libdl/rtl-elf.c File Reference

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions
rtl-elf.c File Reference

RTEMS Run-Time Link Editor. More...

`#include <errno.h>`
`#include <fcntl.h>`
`#include <inttypes.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <stdio.h>`
`#include <unistd.h>`
`#include <rtems/rtl/rtl.h>`
`#include "rtl-elf.h"`
`#include "rtl-error.h"`
`#include <rtems/rtl/rtl-trace.h>`
`#include "rtl-trampoline.h"`
`#include "rtl-unwind.h"`
`#include <rtems/rtl/rtl-unresolved.h>`

## Data Structures
struct | rtems_rtl_elf_reloc_data
struct | rtems_rtl_elf_common_data
struct | rtems_rtl_tramp_data

## Macros
#define | REL_R_OFFSET (0)
#define | REL_R_INFO (1)
#define | REL_R_ADDEND (2)
#define | SEPARATED_PREFIX(_p) { _p, sizeof (_p) - 1 }

## Typedefs
typedef bool(* | rtems_rtl_elf_reloc_handler) (rtems_rtl_obj *obj, bool is_rela, void *relbuf, rtems_rtl_obj_sect *targetsect, rtems_rtl_obj_sym *symbol, Elf_Sym *sym, const char *symname, Elf_Word symvalue, bool resolved, void *data)
typedef struct rtems_rtl_tramp_data | rtems_rtl_tramp_data

## Functions
bool | rtems_rtl_obj_relocate_unresolved (rtems_rtl_unresolv_reloc *reloc, rtems_rtl_obj_sym *sym)
bool | rtems_rtl_elf_file_check (rtems_rtl_obj *obj, int fd)
bool | rtems_rtl_elf_file_load (rtems_rtl_obj *obj, int fd)
bool | rtems_rtl_elf_file_unload (rtems_rtl_obj *obj)
rtems_rtl_loader_format * | rtems_rtl_elf_file_sig (void)

## Detailed Description

RTEMS Run-Time Link Editor.

This is the RTL implementation.

## Macro Definition Documentation

## ◆ REL_R_OFFSET

#define REL_R_OFFSET (0)

The offsets in the reloc words.

## Typedef Documentation

## ◆ rtems_rtl_elf_reloc_handler

typedef bool(* rtems_rtl_elf_reloc_handler) (rtems_rtl_obj *obj, bool is_rela, void *relbuf, rtems_rtl_obj_sect *targetsect, rtems_rtl_obj_sym *symbol, Elf_Sym *sym, const char *symname, Elf_Word symvalue, bool resolved, void *data)

Relocation worker routine.

## ◆ rtems_rtl_tramp_data

typedef struct rtems_rtl_tramp_data rtems_rtl_tramp_data

Struct to handle trampoline reloc recs in the unresolved table.

## Function Documentation

## ◆ rtems_rtl_elf_file_check()

bool rtems_rtl_elf_file_check | ( | rtems_rtl_obj * | obj,
|  | int | fd
| ) |  |

The ELF format check handler.

Parameters

  obj | The object being checked.
  fd | The file descriptor.

## ◆ rtems_rtl_elf_file_load()

bool rtems_rtl_elf_file_load | ( | rtems_rtl_obj * | obj,
|  | int | fd
| ) |  |

The ELF format load handler.

Parameters

  obj | The object to load.
  fd | The file descriptor.

## ◆ rtems_rtl_elf_file_sig()

rtems_rtl_loader_format * rtems_rtl_elf_file_sig | ( | void |  | ) |

The ELF format signature handler.

Returns
  rtems_rtl_loader_format* The format's signature.

## ◆ rtems_rtl_elf_file_unload()

bool rtems_rtl_elf_file_unload | ( | rtems_rtl_obj * | obj | ) |

The ELF format unload handler.

Parameters

  obj | The object to unload.

## ◆ rtems_rtl_obj_relocate_unresolved()

bool rtems_rtl_obj_relocate_unresolved | ( | rtems_rtl_unresolv_reloc * | reloc,
|  | rtems_rtl_obj_sym * | sym
| ) |  |

Relocate an object file's unresolved reference.

Parameters

  rec | The unresolved relocation record.
  sym | The unresolved relocation's referenced symbol.

Return values

  true | The object file record was relocated.
  false | The relocation failed. The RTL error is set.