Originally posted by Weasel
View Post
Originally posted by Weasel
View Post
Originally posted by Weasel
View Post
Originally posted by Weasel
View Post
Its not that the ELF format cannot store the information. Its that the complier/link decides not to store the information and the dynamic linker decides to not to require it and not even process it even when it present.
Originally posted by Weasel
View Post
ELF format can store all the need information. Problem is having implementations. We cannot magically travel back in time and alter what is all ready out there.
Originally posted by Weasel
View Post
What is need is implementations that fully exploit what elf format can do.
Short term this mean using LD_AUDIT, providing your own loaders, libcapsule....
1) provide use cases requiring the elf features.
2) provide personal to work on glibc to implement these features.
Removing global namespace only to end up having to fake recreate it is stupid.
Think about it you could write a PE dynamic loader that disregards all those dll declares on symbols. Then using that loader you could stupidly argue that PE format does not support the feature. This is exactly the case what has happened with ELF. The ELF format supports declaring what library a symbol is from. It is more compact than the PE version. PE version has embedded dll name per symbol entery. Where STT_FILE symbol gives you declaration in batches.
The fact you don't find any STT_FILE symbols defined in gcc/llvm ELF binaries by default and to define them results in having to use linker scripts is a pain.
To make STT_FILE work you will need a lot of the framework stuff that libcapsule is working on.
ELF format is fine. ELF dynamic linkers and ELF compliers need work. Using LD_AUDIT you can patch the existing loader and make it work without needing to modify the elf format and have the information come from the binary is one proof that is not the format and the fact that some UEFI implementations with ELF loaders also have it working. The idea that you have that its ELF format is completely wrong. Its implementations of the ELF format that have it wrong one happens to be a very common one.
Basically PE cannot do as much as ELF does it missing features out it format. Please note dlsym has RTLD_NEXT this also should have you questioning . Why do you need a next look up if a symbol name can only exist once in the ELF link map the answer is you would not need it. Yes the global link map support symbols of the same name from different .so files to be listed it also horrible support same name in 1 so file and this is following the design of the global link map in the ELF format. Using dlinfo you can query what .so file a dlsym load thing is from.
See where not having the STT_FILE symbol support dynamic loader causes problem. Its the STT_FILE symbol that allowed declaring to the dynamic loader what library it should be expecting the following symbols for the imported symbols.
Linux platform Libstdc++ clashes are in fact more often than not exactly the same so name/library name different path something windows loader is not going to help with. STT_FILE used with DT_RUNPATH can cope. In fact making the loader automatically load libraries from DT_RUNPATH into own linkmap and search this link map first for application and application provided libraries and make host libraries resolve with host files in their own link map. This is my problem I don't see that we need the link map per dll as windows does.
We need more than 1 link map. Host and application link maps would go a long way. Host and application link map could be split a lot of the time just by DT_RUNPATH. Yes application doing plugins would still have to declare split link map at plugin load and that would be use dlmopen instead of just dlopen your plugins libcapsule would provide the framework for this.
The biggest problem I have with elf is STT_FILE is not implemented in the common dynamic loaders if it was using symbols of the same name but different soname would not be a problem. You still would have the problem of symbols of the same name from the same library name but on a different path problem. DT_RUNPATH could be used to fix this too just extend the dynamic loader a bit. None of these fix requires altering ELF format.
The link_map design in the elf format documentation tells you that particular problems should not exist in full implementations of the ELF format. Weasel you have been using broken ELF implementations to say what ELF can do.
Comment