8000 Add segment index to segment labels by keir · Pull Request #159 · google/bloaty · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add segment index to segment labels #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/elf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,20 @@ static void DoReadELFSegments(RangeSink* sink, ReportSegmentsBy report_by) {
continue;
}

std::string name = "LOAD [";
// Include the segment index in the label, to support embedded.
//
// Including the index in the segment label differentiates
// segments with the same access control (e.g. RWX vs RW). In
// ELF files built for embedded microcontroller projects, a
// segment is used for each distinct type of memory. In simple
// cases, there is a segment for the flash (which will store
// code and read-only data) and a segment for RAM (which
// usually stores globals, stacks, and maybe a heap). In more
// involved projects, there may be special segments for faster
// RAM (e.g. core coupled RAM or CCRAM), or there may even be
// memory overlays to support manual paging of code from flash
// (which may be slow) into RAM.
std::string name(absl::StrCat("LOAD #", i, " ["));

if (header.p_flags & PF_R) {
name += 'R';
Expand Down
0