RTEMS
5.1
|
RTEMS Run-Time Linker Archive. More...
#include <ctype.h>
#include <dirent.h>
#include <errno.h>
#include <fnmatch.h>
#include <inttypes.h>
#include <stdio.h>
#include <string.h>
#include <rtems/libio_.h>
#include <rtems/rtl/rtl.h>
#include "rtl-chain-iterator.h"
#include <rtems/rtl/rtl-trace.h>
#include "rtl-string.h"
#include "rtl-error.h"
Data Structures | |
struct | rtems_rtl_archive_chain_data |
struct | rtems_rtl_archive_find_data |
struct | rtems_rtl_archive_obj_data |
Macros | |
#define | RTEMS_RTL_AR_IDENT "!<arch>\n" |
#define | RTEMS_RTL_AR_IDENT_SIZE (sizeof (RTEMS_RTL_AR_IDENT) - 1) |
#define | RTEMS_RTL_AR_FHDR_BASE RTEMS_RTL_AR_IDENT_SIZE |
#define | RTEMS_RTL_AR_FNAME (0) |
#define | RTEMS_RTL_AR_FNAME_SIZE (16) |
#define | RTEMS_RTL_AR_SIZE (48) |
#define | RTEMS_RTL_AR_SIZE_SIZE (10) |
#define | RTEMS_RTL_AR_MAGIC (58) |
#define | RTEMS_RTL_AR_MAGIC_SIZE (2) |
#define | RTEMS_RTL_AR_FHDR_SIZE (60) |
#define | RTEMS_RTL_MAX_FILE_SIZE (256) |
Typedefs | |
typedef bool(* | rtems_rtl_archive_iterator) (rtems_rtl_archive *archive, void *data) |
typedef struct rtems_rtl_archive_chain_data | rtems_rtl_archive_chain_data |
typedef struct rtems_rtl_archive_find_data | rtems_rtl_archive_find_data |
typedef struct rtems_rtl_archive_obj_data | rtems_rtl_archive_obj_data |
Functions | |
void | rtems_rtl_archives_open (rtems_rtl_archives *archives, const char *config) |
void | rtems_rtl_archives_close (rtems_rtl_archives *archives) |
bool | rtems_rtl_archives_refresh (rtems_rtl_archives *archives) |
bool | rtems_rtl_archive_load (rtems_rtl_archives *archives, const char *name) |
rtems_rtl_archive_search | rtems_rtl_archive_obj_load (rtems_rtl_archives *archives, const char *symbol, bool load) |
bool | rtems_rtl_obj_archive_find_obj (int fd, size_t fsize, const char **name, off_t *ooffset, size_t *osize, off_t *extended_file_names, rtems_rtl_archive_error error) |
RTEMS Run-Time Linker Archive.
#define RTEMS_RTL_AR_IDENT "!<arch>\n" |
Archive headers.
typedef struct rtems_rtl_archive_chain_data rtems_rtl_archive_chain_data |
Chain iterator data.
typedef bool(* rtems_rtl_archive_iterator) (rtems_rtl_archive *archive, void *data) |
Archive iterator.
bool rtems_rtl_archive_load | ( | rtems_rtl_archives * | archives, |
const char * | name | ||
) |
Load an archive.
archives | The archives data to search. |
name | The archive to load. |
true | The archive is loaded. |
rtems_rtl_archive_search rtems_rtl_archive_obj_load | ( | rtems_rtl_archives * | archives, |
const char * | symbol, | ||
bool | load | ||
) |
Search for a symbol and load the first object file that has the symbol.
archives | The archives data to search. |
symbol | The symbol name to search for. |
load | If @true load the object file the symbol is found in else return the found not found status. |
void rtems_rtl_archives_close | ( | rtems_rtl_archives * | archives | ) |
Close the RTL archives support.
archives | The archives data to close. |
void rtems_rtl_archives_open | ( | rtems_rtl_archives * | archives, |
const char * | config | ||
) |
Open the RTL archives support with the specified configration file.
archives | The archives data to open. |
config | The path to the configuration file. |
bool rtems_rtl_archives_refresh | ( | rtems_rtl_archives * | archives | ) |
Refresh the archives data. Check if the configuration has changes and if it has reload it. Check each path in the configuration and creates archive instances for new archives and remove archives not present any more.
Refreshing is a development aid so reboots can be avoided as users trial configurations that work.
archives | The archives data to refresh. |
false | The refresh failed, an error will have been set. |
bool rtems_rtl_obj_archive_find_obj | ( | int | fd, |
size_t | fsize, | ||
const char ** | name, | ||
off_t * | offset, | ||
size_t * | size, | ||
off_t * | extended_names, | ||
rtems_rtl_archive_error | error | ||
) |
Find a module in an archive returning the offset in the archive and the size. If the name field is pointing to a string pointer and that poniter is NULL and the offset is valid the name is extracted from the archive and filled in. This is used when loading a file from the archive after a symbol is found. The file name is not know and could be extended which requires searching the extended string table in the archive.
fd | Open file handle for the archive. |
fsize | Size of the archive. @paarm name Pointer to the name string. |
offset | The offset of the file in the archive. |
size | The size of the file in the archive. |
extended_names | The offset in the archive for the extended names. |
error | The error handler called on an error. |
true | The file was found in the archive. |
false | The file was not found. |