A bcode file is made up from a number of sections. The first section is a header section which describes the other sections present in the file, giving their locations within the file and their types. This document describes the formats used for the header and other section types.
There may be no more than one section of each type in each file.
struct section_desc { int sect_type; int start; int end; int private1; int private2; };sect_type indicates the type of the section. The first section descriptor record describes the header section so this field has the value HEADER_SECTTYPE. Since this is the first word of the file it is also used as a magic number to identify the file as a bcode file.
start and end give the file offsets of the start of the section and the byte after the end of the section.
private1 and private2 have meanings that are specific to each section type.
The section consists of a sequence of location-symbol pairs. The location is a word offset into the code section and the symbol is a null-terminated string. The pair is followed by further nulls to align the next pair on a word boundary.
The section consists of location-symbol pairs in the same form as the relocations section.