mirror of
https://github.com/openbsd/src.git
synced 2026-06-18 15:23:33 +02:00
Backout previous, the reintroduced code leads to a missing symbol
regress: cc -Wl,--export-dynamic -o t_backtrace t_backtrace.o atf-c.o -lexecinfo ld: error: undefined reference: operator new(unsigned long) >>> referenced by /usr/lib/libexecinfo.so.4.0 (disallowed by --no-allow-shlib-undefined) ok tb@
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/tree.h>
|
||||
|
||||
#include "libunwind.h"
|
||||
#include "config.h"
|
||||
@@ -153,62 +152,6 @@ struct UnwindInfoSections {
|
||||
#endif
|
||||
};
|
||||
|
||||
class UnwindInfoSectionsCache {
|
||||
public:
|
||||
|
||||
struct CacheItem {
|
||||
CacheItem(UnwindInfoSections &uis, uintptr_t pc)
|
||||
: m_uis(uis), m_pc(pc) {
|
||||
}
|
||||
CacheItem(uintptr_t pc)
|
||||
: m_pc(pc) {
|
||||
}
|
||||
|
||||
UnwindInfoSections m_uis;
|
||||
uintptr_t m_pc;
|
||||
|
||||
RB_ENTRY(CacheItem) entry;
|
||||
};
|
||||
|
||||
typedef uintptr_t CacheItemKey;
|
||||
|
||||
int CacheCmp(struct CacheItem *c1, struct CacheItem *c2) {
|
||||
return (c1->m_pc < c2->m_pc ? -1 : c1->m_pc > c2->m_pc);
|
||||
}
|
||||
|
||||
UnwindInfoSectionsCache() {
|
||||
m_head = RB_INITIALIZER(&head);
|
||||
}
|
||||
|
||||
bool getUnwindInfoSectionsForPC(CacheItemKey key, UnwindInfoSections &uis) {
|
||||
UnwindInfoSections *result = nullptr;
|
||||
if (m_prev_req_item && m_prev_req_item->m_pc == key)
|
||||
result = &m_prev_req_item->m_uis;
|
||||
else {
|
||||
struct CacheItem find(key), *res;
|
||||
res = RB_FIND(CacheTree, &m_head, &find);
|
||||
if (res) {
|
||||
m_prev_req_item = res;
|
||||
result = &res->m_uis;
|
||||
}
|
||||
}
|
||||
if (result) {
|
||||
uis = *result;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void setUnwindInfoSectionsForPC(CacheItemKey key, UnwindInfoSections &uis) {
|
||||
CacheItem *p_item(new CacheItem(uis, key));
|
||||
RB_INSERT(CacheTree, &m_head, p_item);
|
||||
}
|
||||
|
||||
private:
|
||||
CacheItem *m_prev_req_item = nullptr;
|
||||
RB_HEAD(CacheTree, CacheItem) m_head;
|
||||
RB_GENERATE(CacheTree, CacheItem, entry, CacheCmp);
|
||||
};
|
||||
|
||||
/// LocalAddressSpace is used as a template parameter to UnwindCursor when
|
||||
/// unwinding a thread in the same process. The wrappers compile away,
|
||||
|
||||
@@ -90,8 +90,6 @@ extern "C" _Unwind_Reason_Code __libunwind_seh_personality(
|
||||
|
||||
namespace libunwind {
|
||||
|
||||
static thread_local UnwindInfoSectionsCache uwis_cache;
|
||||
|
||||
#if defined(_LIBUNWIND_SUPPORT_DWARF_UNWIND)
|
||||
/// Cache of recently found FDEs.
|
||||
template <typename A>
|
||||
@@ -2602,14 +2600,7 @@ void UnwindCursor<A, R>::setInfoBasedOnIPRegister(bool isReturnAddress) {
|
||||
|
||||
// Ask address space object to find unwind sections for this pc.
|
||||
UnwindInfoSections sects;
|
||||
bool have_sects = false;
|
||||
if (uwis_cache.getUnwindInfoSectionsForPC(pc, sects))
|
||||
have_sects = true;
|
||||
else if (_addressSpace.findUnwindSections(pc, sects)) {
|
||||
uwis_cache.setUnwindInfoSectionsForPC(pc, sects);
|
||||
have_sects = true;
|
||||
}
|
||||
if (have_sects) {
|
||||
if (_addressSpace.findUnwindSections(pc, sects)) {
|
||||
#if defined(_LIBUNWIND_SUPPORT_COMPACT_UNWIND)
|
||||
// If there is a compact unwind encoding table, look there first.
|
||||
if (sects.compact_unwind_section != 0) {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#ifndef UNWIND_ASSEMBLY_H
|
||||
#define UNWIND_ASSEMBLY_H
|
||||
|
||||
#if defined(__CET__)
|
||||
#if defined(__linux__) && defined(__CET__)
|
||||
#include <cet.h>
|
||||
#define _LIBUNWIND_CET_ENDBR _CET_ENDBR
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user