You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remove cross OS DAC dependence on TARGET_ALPINE_LINUX #32756
As part of #32322@jkotas suggested that the Linux and Alpine Cross OS DACs do not necessarily need to be different. It would be nice to just build one of them.
However in fixing the alpine build breaks introduced by the original elf-reader implementation #32579
introduced a dependence on TARGET_ALPINE_LINUX in the elf-reader.
It would be nice to eliminate this dependence. I suspect it should be feasible.
The root cause for the dependence is a difference in how the loader populates the symbol tables. For most unix variants the symbol table is fixed up to contain absolute addresses rather than the relative addresses as stored on disk.
Possible ideas:
My initial idea was to simply probe both addresses and look for a well known token. This is a bit costly as it could lead to segment faults when we probe an unmapped address.
The next idea is simpler. If the symbol lookup results in a symbol with address less than the module base address then add the base address. This would work for most realistic cases. It would fail if the module was loaded at an address smaller than its size. This is a bit fragile....
If we combine the two ideas, it seems we can fully cover the bases.
Discussion topics:
Should we try to only build one Cross OS DAC for Linux & Alpine?
I looked all over the web and didn't find anything, but there wasn't much on the in-memory layout/format. It was all about the file format itself. None of the other distros we test on (ubuntu, fedora, debian, opensuse) have this problem. I think alpine's loader just doesn't fix up these RVAs.
Activity
jkotas commentedon Feb 24, 2020
I would expect the ELF format to have enum somewhere that describes the type of table. Is there one that we can get to?
mikem8361 commentedon Feb 28, 2020
I looked all over the web and didn't find anything, but there wasn't much on the in-memory layout/format. It was all about the file format itself. None of the other distros we test on (ubuntu, fedora, debian, opensuse) have this problem. I think alpine's loader just doesn't fix up these RVAs.
sdmaclea commentedon Mar 12, 2020
We discussed this briefly a few days ago in our stand up meeting. The consensus was we can
createdumphas more flexibility. For it a dependence onTARGET_ALPINE_LINUXis acceptable.sdmaclea commentedon May 16, 2020
We discussed the #34314 PR which fixed this issue. At the moment the added complexity was not worth it.
Closing the issue as will not fix