write appends a null-terminated string and returns its starting index.
(s string)
| 845 | |
| 846 | // write appends a null-terminated string and returns its starting index. |
| 847 | func (b *buf) write(s string) uint32 { |
| 848 | res := uint32(len(b.data)) |
| 849 | b.data = append(b.data, s...) |
| 850 | b.data = append(b.data, '\x00') |
| 851 | return res |
| 852 | } |
| 853 | |
| 854 | // fakeELFFile generates a minimal valid ELF file, with fake .head.text and |
| 855 | // .text sections, and their corresponding _text and _stext start symbols, |