Support generic Elf notes, with unit tests

A=Mike Hommey <mh@glandium.org>
R=ted at https://breakpad.appspot.com/546002/

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1142 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
ted.mielczarek@gmail.com 2013-04-04 16:24:44 +00:00
parent 3a8617eb8c
commit 6dc56cca44
4 changed files with 63 additions and 27 deletions

View file

@ -177,13 +177,16 @@ class SymbolTable : public Section {
StringTable& table_;
};
// A class to build GNU Build ID note sections
class BuildIDNote : public Section {
// A class for note sections
class Notes : public Section {
public:
BuildIDNote(const uint8_t* id_bytes, size_t id_size, Endianness endianness);
Notes(Endianness endianness)
: Section(endianness) {
}
// Append a new Build ID note section to |elf|.
static void AppendSection(ELF& elf, const uint8_t* id_bytes, size_t id_size);
// Add a note.
void AddNote(int type, const string &name, const uint8_t* desc_bytes,
size_t desc_size);
};
} // namespace synth_elf