Chromium Code Reviews| Index: native_client_sdk/src/libraries/xray/symtable.c |
| diff --git a/native_client_sdk/src/libraries/xray/symtable.c b/native_client_sdk/src/libraries/xray/symtable.c |
| index 52f5c2b9ee33f2a5be0d52bd127c7609f6719a09..ea87ec8092333c718ab1b6f42aed042c1d24be06 100644 |
| --- a/native_client_sdk/src/libraries/xray/symtable.c |
| +++ b/native_client_sdk/src/libraries/xray/symtable.c |
| @@ -16,6 +16,7 @@ |
| #endif |
| #include "xray/xray_priv.h" |
| +#define PNACL_STRING_OFFSET (0x10000000) |
| #if defined(XRAY) |
| @@ -145,6 +146,20 @@ struct XRaySymbol* XRaySymbolTableLookup(struct XRaySymbolTable* symtab, |
| uint32_t addr) { |
| void *x = XRayHashTableLookup(symtab->hash_table, addr); |
| struct XRaySymbol* r = (struct XRaySymbol*)x; |
| + |
| +#if defined(__pnacl__) |
| + if (r == NULL) { |
| + /* Addresses are trimed to 24 bits for internal storage, so we need to |
| + * add this offset back in order to get the real address. |
| + */ |
| + |
|
nfullagar1
2013/07/18 18:21:06
remove blank line
grosse
2013/07/18 20:45:37
Done.
|
| + addr |= PNACL_STRING_OFFSET; |
| + const char* name = (const char*)addr; |
| + struct XRaySymbol* symbol = XRaySymbolCreate(symtab->symbol_pool, name); |
| + r = XRaySymbolTableAdd(symtab, symbol, addr); |
| + } |
| +#endif |
| + |
| #if defined(__GLIBC__) |
| if (r == NULL) { |
| Dl_info info; |