GarbageCollection.cpp don't check `hasOldInputFile()` like other diagnostic paths do

Open Beginner friendly
#1,641 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
cpp
Domain
compilers

Research direction

Open GarbageCollection.cpp and inspect GarbageCollection::stripSections(), then compare its origin-tracking logic with the other diagnostic paths that check hasOldInputFile(). Update the diagnostic handling so the same old-input-file pattern is followed for the relevant section types, and verify that diagnostic output reflects the original input without changing functional behavior.

Written by the indexing model from the issue text.

Description

I noticed that GarbageCollection::stripSections() only checks CommonELFSection for origin tracking, but other diagnostic paths in the codebase check hasOldInputFile() for all section types

GC should follow the same pattern.

if (IsCommonSection && Section->hasOldInputFile()) {
  I = Section->getOldInputFile()->getInput();
}

After PR #1585 we can remove IsCommonSection check.
Diagnostic change only, no functional impact.

Dominant language
C++
Stars
259
Forks
84
Avg merge
2d 8h
Merged PRs (30d)
76

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from qualcomm/eld

All issues in qualcomm/eld

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.