This addresses a lot of the comments in D89257: [lld-macho] Emit STABS symbols for debugging, and drop debug sections. Ideally it'd have been
done in the same diff, but the commits in between make that difficult.
This diff implements:
- N_GSYM and N_STSYM, the STABS for global and static symbols
- Has the STABS reflect the section IDs of their referent symbols
- Ensures we don't fail when encountering absolute symbols or files with no debug info
- Sorts STABS symbols by file to minimize the number of N_OSO entries
You shouldn't need this because of lines 634 and 635 skips adding absolute symbols to symbolsNeedingStabs