symbol-tables

Binary Trees vs. Linked Lists vs. Hash Tables

泪湿孤枕 提交于 2019-12-17 15:04:13
问题 I'm building a symbol table for a project I'm working on. I was wondering what peoples opinions are on the advantages and disadvantages of the various methods available for storing and creating a symbol table. I've done a fair bit of searching and the most commonly recommended are binary trees or linked lists or hash tables. What are the advantages and or disadvantages of all of the above? (working in c++) 回答1: Your use case is presumably going to be "insert the data once (e.g., application

Can a running C program access its own symbol table?

拟墨画扇 提交于 2019-12-06 19:03:19
问题 I have a linux C program that handles request sent to a TCP socket (bound to a particular port). I want to be able to query the internal state of the C program via a request to that port, but I dont want to hard code what global variables can be queried. Thus I want the query to contain the string name of a global and the C code to look that string up in the symbol table to find its address and then send its value back over the TCP socket. Of course the symbol table must not have been

Accessing ELF symbol table in C

时光毁灭记忆、已成空白 提交于 2019-12-06 01:28:42
问题 I'm writing a program to mimic elfdump -ecps It currently prints out the elf header, program headers, and section headers correctly, but I'm stuck on the last few parts of the symbol table. the desired output is in the format of: Symbol Table Section: .dynsym index value size type bind oth ver shndx name [0] 0x00000000 0x00000000 NOTY LOCL D 0 UNDEF [1] 0x00025c0c 0x00000000 FUNC GLOB D 2 UNDEF .udiv [2] 0x00025e00 0x00000140 OBJT WEAK D 1 .bss _iob [3] 0x00025b24 0x00000000 OBJT GLOB P 1

Determine load address and entry point of stripped Linux Kernel image

…衆ロ難τιáo~ 提交于 2019-12-05 06:35:10
问题 I have a crosscompiling toolchain for an embedded system (mipsel) on my x86 Linux. I know how to build a custom kernel (let's call the image "vmlinux") for it and how to strip that image via objcopy -S -O binary vmlinux vmlinux.bin For further processing I also need the load address and entry point of the image. Before stripping it is no problem to determine them via scripts/mksysmap or, more explicitly, via nm -n vmlinux | grep -v '\( [aNUw] \)\|\(__crc_\)\|\( \$[adt]\)' > System.map Then I

Can a running C program access its own symbol table?

a 夏天 提交于 2019-12-05 01:35:42
I have a linux C program that handles request sent to a TCP socket (bound to a particular port). I want to be able to query the internal state of the C program via a request to that port, but I dont want to hard code what global variables can be queried. Thus I want the query to contain the string name of a global and the C code to look that string up in the symbol table to find its address and then send its value back over the TCP socket. Of course the symbol table must not have been stripped. So can the C program even locate its own symbol table, and is there a library interface for looking

Binary Trees vs. Linked Lists vs. Hash Tables

你离开我真会死。 提交于 2019-11-27 16:40:59
I'm building a symbol table for a project I'm working on. I was wondering what peoples opinions are on the advantages and disadvantages of the various methods available for storing and creating a symbol table. I've done a fair bit of searching and the most commonly recommended are binary trees or linked lists or hash tables. What are the advantages and or disadvantages of all of the above? (working in c++) Your use case is presumably going to be "insert the data once (e.g., application startup) and then perform lots of reads but few if any extra insertions". Therefore you need to use an