Skip to content
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

fix Issue 17761 - don't leave behind empty section groups #7093

Merged
merged 2 commits into from Aug 25, 2017

Conversation

MartinNowak
Copy link
Member

@MartinNowak MartinNowak commented Aug 21, 2017

  • check for existing .text. section before opening new
    group section, reuse existing sections in case of colliding mangling

Until now it wasn't easily possible to lookup an existing section, hence the refactoring was necessary for the fix. At best review commits separately. I've also added more detailed documentation to those functions.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @MartinNowak!

Bugzilla references

Auto-close Bugzilla Description
17761 [REG2.075] dmd 2.075.1 creates object files that can't be linked by ld.bfd

Returns:
String index of new or existing section name.
*/
static IDXSEC elf_addsectionname(const char *name, const char *suffix = NULL, bool *padded = NULL)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should return IDXSTR

Copy link
Member

@WalterBright WalterBright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace IDXSEC on line 623 with IDXSTR.

- split into elf_addsectionname, elf_addsegment, and elf_getsegment
- add out parameter to addsectionname for newly added entries
- check for existing .text.<mangling> section before opening new
  group section, reuse existing sections in case of colliding mangling
@MartinNowak
Copy link
Member Author

Done @WalterBright

@MartinNowak MartinNowak merged commit 9ffacf2 into dlang:stable Aug 25, 2017
@MartinNowak MartinNowak deleted the fix17761 branch August 25, 2017 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants