mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2025-01-09 19:03:43 +01:00
Remove the ARM_EXIDX_TABLE_MALLOC code path.
Using malloc is not an option since unw_init_local and unw_step are supposed to be async signal safe. Therefore this code path can be removed. Signed-off-by: Ken Werner <ken.werner@linaro.org>
This commit is contained in:
parent
6296ff1fb2
commit
f053677198
2 changed files with 2 additions and 30 deletions
|
@ -36,9 +36,6 @@ struct arm_exidx_table {
|
||||||
struct arm_exidx_entry *end;
|
struct arm_exidx_entry *end;
|
||||||
void *start_addr;
|
void *start_addr;
|
||||||
void *end_addr;
|
void *end_addr;
|
||||||
#ifdef ARM_EXIDX_TABLE_MALLOC
|
|
||||||
struct arm_exidx_table *next;
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum arm_exbuf_cmd {
|
typedef enum arm_exbuf_cmd {
|
||||||
|
|
|
@ -33,18 +33,15 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
|
|
||||||
#define ARM_EXTBL_OP_FINISH 0xb0
|
#define ARM_EXTBL_OP_FINISH 0xb0
|
||||||
|
|
||||||
|
#define ARM_EXIDX_TABLE_LIMIT 32
|
||||||
|
|
||||||
enum arm_exbuf_cmd_flags {
|
enum arm_exbuf_cmd_flags {
|
||||||
ARM_EXIDX_VFP_SHIFT_16 = 1 << 16,
|
ARM_EXIDX_VFP_SHIFT_16 = 1 << 16,
|
||||||
ARM_EXIDX_VFP_DOUBLE = 1 << 17,
|
ARM_EXIDX_VFP_DOUBLE = 1 << 17,
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef ARM_EXIDX_TABLE_MALLOC
|
|
||||||
static struct arm_exidx_table *arm_exidx_table_list;
|
|
||||||
#else
|
|
||||||
#define ARM_EXIDX_TABLE_LIMIT 32
|
|
||||||
static struct arm_exidx_table arm_exidx_tables[ARM_EXIDX_TABLE_LIMIT];
|
static struct arm_exidx_table arm_exidx_tables[ARM_EXIDX_TABLE_LIMIT];
|
||||||
static unsigned arm_exidx_table_count = 0;
|
static unsigned arm_exidx_table_count = 0;
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline uint32_t
|
static inline uint32_t
|
||||||
prel31_read (uint32_t prel31)
|
prel31_read (uint32_t prel31)
|
||||||
|
@ -62,33 +59,16 @@ prel31_to_addr (void *addr)
|
||||||
static void
|
static void
|
||||||
arm_exidx_table_reset_all (void)
|
arm_exidx_table_reset_all (void)
|
||||||
{
|
{
|
||||||
#ifdef ARM_EXIDX_TABLE_MALLOC
|
|
||||||
while (NULL != arm_exidx_table_list)
|
|
||||||
{
|
|
||||||
struct arm_exidx_table *next = arm_exidx_table_list->next;
|
|
||||||
free (arm_exidx_table_list);
|
|
||||||
arm_exidx_table_list = next;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
arm_exidx_table_count = 0;
|
arm_exidx_table_count = 0;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HIDDEN int
|
HIDDEN int
|
||||||
arm_exidx_table_add (const char *name,
|
arm_exidx_table_add (const char *name,
|
||||||
struct arm_exidx_entry *start, struct arm_exidx_entry *end)
|
struct arm_exidx_entry *start, struct arm_exidx_entry *end)
|
||||||
{
|
{
|
||||||
#ifdef ARM_EXIDX_TABLE_MALLOC
|
|
||||||
struct arm_exidx_table *table = malloc (sizeof (*table));
|
|
||||||
if (NULL == table)
|
|
||||||
return -1;
|
|
||||||
table->next = arm_exidx_table_list;
|
|
||||||
arm_exidx_table_list = table;
|
|
||||||
#else
|
|
||||||
if (arm_exidx_table_count >= ARM_EXIDX_TABLE_LIMIT)
|
if (arm_exidx_table_count >= ARM_EXIDX_TABLE_LIMIT)
|
||||||
return -1;
|
return -1;
|
||||||
struct arm_exidx_table *table = &arm_exidx_tables[arm_exidx_table_count++];
|
struct arm_exidx_table *table = &arm_exidx_tables[arm_exidx_table_count++];
|
||||||
#endif
|
|
||||||
table->name = name;
|
table->name = name;
|
||||||
table->start = start;
|
table->start = start;
|
||||||
table->end = end;
|
table->end = end;
|
||||||
|
@ -106,15 +86,10 @@ HIDDEN struct arm_exidx_table *
|
||||||
arm_exidx_table_find (void *pc)
|
arm_exidx_table_find (void *pc)
|
||||||
{
|
{
|
||||||
struct arm_exidx_table *table;
|
struct arm_exidx_table *table;
|
||||||
#ifdef ARM_EXIDX_TABLE_MALLOC
|
|
||||||
for (table = arm_exidx_table_list; table != NULL; table = table->next)
|
|
||||||
{
|
|
||||||
#else
|
|
||||||
unsigned i;
|
unsigned i;
|
||||||
for (i = 0; i < arm_exidx_table_count; i++)
|
for (i = 0; i < arm_exidx_table_count; i++)
|
||||||
{
|
{
|
||||||
table = &arm_exidx_tables[i];
|
table = &arm_exidx_tables[i];
|
||||||
#endif
|
|
||||||
if (pc >= table->start_addr && pc < table->end_addr)
|
if (pc >= table->start_addr && pc < table->end_addr)
|
||||||
return table;
|
return table;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue