code: func newMapping(prof *profile.Profile, obj plugin.ObjTool, ui plugin.UI, force bool) (*mappingTable, error) {
  	mt := &mappingTable{
  		prof:     prof,
  		segments: make(map[*profile.Mapping]plugin.ObjFile),
  	}
  
  	// Identify used mappings
  	mappings := make(map[*profile.Mapping]bool)
  	for _, l := range prof.Location {
  		mappings[l.Mapping] = true
  	}
  
  	for _, m := range prof.Mapping {
  		if !mappings[m] {
  			continue
  		}
  		// Do not attempt to re-symbolize a mapping that has already been symbolized.
  		if !force && (m.HasFunctions || m.HasFilenames || m.HasLineNumbers) {
  			continue
  		}
  
  		f, err := locateFile(obj, m.File, m.BuildID, m.Start)
  		if err != nil {
  			ui.PrintErr("Local symbolization failed for ", filepath.Base(m.File), ": ", err)
  			// Move on to other mappings
  			continue
  		}
  
  		if fid := f.BuildID(); m.BuildID != "" && fid != "" && fid != m.BuildID {
  			// Build ID mismatch - ignore.
  			f.Close()
  			continue
  		}
  
  		mt.segments[m] = f
  	}
  
  	return mt, nil
  }
docs: // newMapping creates a mappingTable for a profile.