| OLD | NEW |
| 1 #include "common/linux/synth_elf.h" | 1 #include "common/linux/synth_elf.h" |
| 2 | 2 |
| 3 #include <assert.h> | 3 #include <assert.h> |
| 4 #include <elf.h> | 4 #include <elf.h> |
| 5 #include <stdio.h> | 5 #include <stdio.h> |
| 6 #include <string.h> | 6 #include <string.h> |
| 7 | 7 |
| 8 #include "common/linux/elf_gnu_compat.h" | 8 #include "common/linux/elf_gnu_compat.h" |
| 9 #include "common/using_std_string.h" | 9 #include "common/using_std_string.h" |
| 10 | 10 |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 program_count_label_ = program_count_; | 206 program_count_label_ = program_count_; |
| 207 | 207 |
| 208 // Section header table starts here. | 208 // Section header table starts here. |
| 209 Mark(§ion_header_label_); | 209 Mark(§ion_header_label_); |
| 210 Append(section_header_table_); | 210 Append(section_header_table_); |
| 211 } | 211 } |
| 212 | 212 |
| 213 SymbolTable::SymbolTable(Endianness endianness, | 213 SymbolTable::SymbolTable(Endianness endianness, |
| 214 size_t addr_size, | 214 size_t addr_size, |
| 215 StringTable& table) : Section(endianness), | 215 StringTable& table) : Section(endianness), |
| 216 addr_size_(addr_size), | |
| 217 table_(table) { | 216 table_(table) { |
| 217 #ifndef NDEBUG |
| 218 addr_size_ = addr_size; |
| 219 #endif |
| 218 assert(addr_size_ == 4 || addr_size_ == 8); | 220 assert(addr_size_ == 4 || addr_size_ == 8); |
| 219 } | 221 } |
| 220 | 222 |
| 221 void SymbolTable::AddSymbol(const string& name, uint32_t value, | 223 void SymbolTable::AddSymbol(const string& name, uint32_t value, |
| 222 uint32_t size, unsigned info, uint16_t shndx) { | 224 uint32_t size, unsigned info, uint16_t shndx) { |
| 223 assert(addr_size_ == 4); | 225 assert(addr_size_ == 4); |
| 224 D32(table_.Add(name)); | 226 D32(table_.Add(name)); |
| 225 D32(value); | 227 D32(value); |
| 226 D32(size); | 228 D32(size); |
| 227 D8(info); | 229 D8(info); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 252 Append(reinterpret_cast<const uint8_t*>(¬e_header), | 254 Append(reinterpret_cast<const uint8_t*>(¬e_header), |
| 253 sizeof(note_header)); | 255 sizeof(note_header)); |
| 254 AppendCString(name); | 256 AppendCString(name); |
| 255 Align(4); | 257 Align(4); |
| 256 Append(desc_bytes, desc_size); | 258 Append(desc_bytes, desc_size); |
| 257 Align(4); | 259 Align(4); |
| 258 } | 260 } |
| 259 | 261 |
| 260 } // namespace synth_elf | 262 } // namespace synth_elf |
| 261 } // namespace google_breakpad | 263 } // namespace google_breakpad |
| OLD | NEW |