Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.

WIP: Extract ELF section reading from rt.backtrace.elf to core.elf#147

Closed
kinke wants to merge 9 commits intoldc-developers:ldcfrom
kinke:elf
Closed

WIP: Extract ELF section reading from rt.backtrace.elf to core.elf#147
kinke wants to merge 9 commits intoldc-developers:ldcfrom
kinke:elf

Conversation

@kinke
Copy link
Member

@kinke kinke commented Oct 10, 2018

Incl. some refactoring. Still needs to be verified; there are surely obsolete imports etc.

@kinke
Copy link
Member Author

kinke commented Oct 10, 2018

Pinging @joakim-noah.


return null;
// debug_line section found and loaded
return cast(const(ubyte)[]) ElfSection(file, dbgSectionHeader).get();
Copy link
Member Author

Choose a reason for hiding this comment

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

This should be blatantly wrong, unmapping the section data right before returning the slice. I wonder why the original code seems to be working...

@joakim-noah
Copy link

Good idea, why isn't this submitted upstream?

@kinke
Copy link
Member Author

kinke commented Oct 11, 2018

Needs to be tested and polished first, and I'll probably do this here by simplifying the DSO registration further (no magic linker symbols for the .minfo section required anymore).

@joakim-noah
Copy link

OK, will this get in before the final 1.12 release?

@kinke
Copy link
Member Author

kinke commented Oct 11, 2018

Nope, definitely not.

@kinke kinke force-pushed the elf branch 4 times, most recently from 81b5e57 to 28a73c5 Compare October 11, 2018 21:25
@kinke
Copy link
Member Author

kinke commented Oct 12, 2018

The backtrace generation code is working fine on Linux x64.

I'll move some other pieces from rt.sections_elf_shared to the new module, in order to finally expose convenience functions like const(void)[] getSectionByName(void* someAddressInDesiredDSO, const(char)* sectionName).

kinke added 6 commits October 14, 2018 13:08
Including some tiny refactorings from my side (mainly wrt. overdue
`DSO.tlsRange()`), which I'll propose with some earlier adaptations
upstream later. There have been numerous merge conflicts wrt. to this
file in the past; upstreaming our OSX adaptations to enable/help with
shared Phobos support for DMD might be feasible as well.
Incl. some minor refactoring (pointer to ref, make `findSectionByName()`
an ElfFile method, add `findSectionHeaderByName()` convenience method
etc.).
@kinke
Copy link
Member Author

kinke commented Oct 14, 2018

Now a branch in the official repo and tested by ldc-developers/ldc#2875.

@kinke kinke closed this Oct 14, 2018
@kinke kinke deleted the elf branch October 14, 2018 14:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants