#include "objectFile.h"
#include "hashmap.h"
#include "graph.h"
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
Go to the source code of this file.
Defines | |
#define | SO_FOUNDNAME 1 |
#define | SO_FOUNDSECTION 2 |
#define | SO_PREFIX_COUNT (sizeof(prefix)/sizeof(char*)) |
#define | SO_WEAK_COUNT (sizeof(weak)/sizeof(char*)) |
Functions | |
static char * | trim (char *src) |
Removes leading space from a string. | |
static void | upper (char *src) |
Converts a string into upper case. | |
static void | parseRelocSection (graph *src, FILE *file) |
Parses the relocation section of the generated object file. | |
static void | colorizeGraph (graph *seed, unsigned long color) |
Colorizes a graph starting from a given seed. | |
objectFile * | objectFileCreate (const char *name) |
Creates a new object file and returns a pointer to it. | |
void | objectFileCollect (objectFile *src, FILE *file) |
Collects all the sections from a objdump generated file. | |
void | objectFileCompute (list *oFiles, FILE *file) |
Computes the dependencies between the various sections of the objects. | |
void | objectFileColorize (const char *seed, unsigned long color) |
Recursively colorizes the dependency graph starting with seed. Two colors get mixed using binary OR. | |
list * | objectFileGetUsed (objectFile *src) |
Returns a list containing all used sections. | |
list * | objectFileGetUnused (objectFile *src) |
Returns a list containing all unused sections. | |
const char * | objectFileGetName (objectFile *src) |
Returns the name of the given object file. | |
void | objectFileDumpMap (list *oFiles) |
Dumps the dependency graph XML-like formatted to stdout. | |
void | objectFileDumpUsed (list *oFiles) |
Dumps the used sections in XML-like formatted to stdout. | |
void | objectFileDumpUnused (list *oFiles) |
Dumps the unused sections in XML format to stdout. | |
Variables | |
static const char * | prefix [] |
static const char * | weak [] |
static hashmap * | sectionMap = 0 |
static list * | unknownSection = 0 |
Definition in file objectFile.c.
#define SO_FOUNDNAME 1 |
Definition at line 17 of file objectFile.c.
#define SO_FOUNDSECTION 2 |
Definition at line 18 of file objectFile.c.
#define SO_PREFIX_COUNT (sizeof(prefix)/sizeof(char*)) |
Definition at line 20 of file objectFile.c.
#define SO_WEAK_COUNT (sizeof(weak)/sizeof(char*)) |
Definition at line 21 of file objectFile.c.
static void colorizeGraph | ( | graph * | seed, | |
unsigned long | color | |||
) | [static] |
Colorizes a graph starting from a given seed.
[in] | seed | initial node |
[in] | color | the color |
Definition at line 156 of file objectFile.c.
void objectFileCollect | ( | objectFile * | src, | |
FILE * | file | |||
) |
Collects all the sections from a objdump generated file.
Definition at line 182 of file objectFile.c.
void objectFileColorize | ( | const char * | seed, | |
unsigned long | color | |||
) |
Recursively colorizes the dependency graph starting with seed. Two colors get mixed using binary OR.
Definition at line 376 of file objectFile.c.
void objectFileCompute | ( | list * | oFiles, | |
FILE * | file | |||
) |
Computes the dependencies between the various sections of the objects.
Definition at line 245 of file objectFile.c.
objectFile* objectFileCreate | ( | const char * | name | ) |
void objectFileDumpMap | ( | list * | oFiles | ) |
Dumps the dependency graph XML-like formatted to stdout.
Definition at line 423 of file objectFile.c.
void objectFileDumpUnused | ( | list * | oFiles | ) |
void objectFileDumpUsed | ( | list * | oFiles | ) |
Dumps the used sections in XML-like formatted to stdout.
Definition at line 463 of file objectFile.c.
const char* objectFileGetName | ( | objectFile * | src | ) |
list* objectFileGetUnused | ( | objectFile * | src | ) |
list* objectFileGetUsed | ( | objectFile * | src | ) |
static void parseRelocSection | ( | graph * | src, | |
FILE * | file | |||
) | [static] |
Parses the relocation section of the generated object file.
[in] | src | marks the node assigned to the section |
[in] | file | handle to the file |
Definition at line 68 of file objectFile.c.
static char* trim | ( | char * | src | ) | [static] |
Removes leading space from a string.
[in] | src | string to trim |
Definition at line 45 of file objectFile.c.
static void upper | ( | char * | src | ) | [static] |
Converts a string into upper case.
[in] | src | string to convert |
Definition at line 55 of file objectFile.c.
const char* prefix[] [static] |
hashmap* sectionMap = 0 [static] |
Definition at line 28 of file objectFile.c.
list* unknownSection = 0 [static] |
Definition at line 29 of file objectFile.c.
const char* weak[] [static] |