Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

shared library support for FreeBSD #1068

Merged
merged 5 commits into from
Jan 23, 2015
Merged

Conversation

MartinNowak
Copy link
Member

  • use handle instead of linkmap to identify DSOs
  • merge rt.sections_freebsd and rt.sections_linux into rt.sections_elf_shared
  • handle the few OS specific differences

@joakim-noah
Copy link
Contributor

Oh, nice work, good to see FreeBSD ushered into the shared library club. :)

I've been thinking about using your DSO registry sections for Android too, will see if I can get that to work.

- handle is the natural identifier of a loaded DSO

- it's easier on FreeBSD to get obtain an handle from a
  DSO internal address than to get the link_map
- use local symbol to get handle of druntime
- relocate elf stringtable entry
- dlopen(RTLD_NOLOAD) increfs on linux, but not on FBSD
- use getprogname instead of program_invocation_name
- also add @nogc overload to dl_iterate_phdr and such
- C host must explicitly be linked against pthread

- need dummy ref to _d_dso_registry to support weak linkage
@MartinNowak
Copy link
Member Author

requires dlang/dmd#4223 and dlang/dmd#4224

@MartinNowak
Copy link
Member Author

works now

@joakim-noah
Copy link
Contributor

Hope this gets in soon. rt.sections_elf_shared would benefit from some documentation comments about the DSO registry scheme you're using, particularly now that it's being used on multiple ELF platforms. Other than that and not really following all the shared library code because I'm not familiar with all the technical details, LGTM, as it passes the tests on FreeBSD.

@MartinNowak
Copy link
Member Author

DSO registry scheme you're using

Well, the each DSO calls into druntime and registers it's metadata sort of scheme.

@joakim-noah
Copy link
Contributor

the each DSO calls into druntime and registers it's metadata sort of scheme

Right, it would help others if you expand that description out into more detail, in an overview comment like this. That OS X TLS scheme is much simpler than what you're doing, yet it does a better job of actually describing what the overall scheme is doing. Your code has some good comments in various places, but would benefit from a better overall description.

@MartinNowak
Copy link
Member Author

Passes since a week!

@MartinNowak
Copy link
Member Author

ping

@MartinNowak
Copy link
Member Author

Starts to bitrot, can we please merge this?
There are enough tests to cover these changes.

@MartinNowak
Copy link
Member Author

Auto-merge toggled on

MartinNowak added a commit that referenced this pull request Jan 23, 2015
shared library support for FreeBSD
@MartinNowak MartinNowak merged commit 2bccc29 into dlang:master Jan 23, 2015
@MartinNowak MartinNowak deleted the sharedFBSD branch January 23, 2015 10:14
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