Post AdNja3M9MfzhhF0Syu by SpaceLifeForm@infosec.exchange
(DIR) More posts by SpaceLifeForm@infosec.exchange
(DIR) Post #AdM7f6k0DWIeE3Bd1E by mjg59@nondeterministic.computer
2023-12-31T03:22:42Z
0 likes, 0 repeats
In the absence of a dynamic symbol section, is there a way for me to tell the linker that a particular symbol is at a specific address in a library?
(DIR) Post #AdMKfD287Yqx942nxY by mjg59@nondeterministic.computer
2023-12-31T05:48:22Z
0 likes, 0 repeats
@SpaceLifeForm That appears to be "Tell the linker to put this symbol at this address", while I want "Tell the linker that this symbol is at this offset in this object"
(DIR) Post #AdMOW2cFsmoI2xpEUi by mjg59@nondeterministic.computer
2023-12-31T06:30:44Z
0 likes, 0 repeats
@SpaceLifeForm I have a binary .so that doesn't have a .dynamic section, and so the linker is unable to find the addresses of the functions within it. I know the addresses, and would like to tell the linker what they are.
(DIR) Post #AdMeCk3OGsscF1Kx04 by RupertReynolds@hachyderm.io
2023-12-31T09:26:38Z
0 likes, 0 repeats
@mjg59 Reminds me of the 1980s, working on 1960s code!(ignorance of modern linkers follows) Can you include a dummy module with the symbols/addresses and have the linker find them that way?
(DIR) Post #AdMkMGN65DR6nwTgiO by ersatzmaus@mastodon.social
2023-12-31T10:36:02Z
0 likes, 0 repeats
@mjg59 @SpaceLifeForm Can you do what libcapsule does: Shim dso with a symbol of that name and scribble on its GOT in its init?
(DIR) Post #AdNgcGQlQRyWxkWkeO by SpaceLifeForm@infosec.exchange
2023-12-31T20:54:20Z
0 likes, 0 repeats
@ersatzmaus @mjg59 The more I think about this, I suspect the .so file in question is really a static PIE (executable) not a library.You should be able to execute it from your shell to verify this. It may quickly exit, but will confirm.So, I doubt it will be possible to jump (call) to code in the .so file because there will be things not initialzed.Trying to refresh my memory on this from MUSL mailing list.@dalias can confirm if I am mis-remembering why and the reason the dynamic loader exists in the static PIE.hXXps://news.ycombinator.com/item?id=23655167
(DIR) Post #AdNgcYRmRPU2q78ojY by mjg59@nondeterministic.computer
2023-12-31T21:28:49Z
0 likes, 0 repeats
@SpaceLifeForm @ersatzmaus @dalias no, it's definitely a library
(DIR) Post #AdNja3M9MfzhhF0Syu by SpaceLifeForm@infosec.exchange
2023-12-31T22:00:48Z
0 likes, 0 repeats
@mjg59 @ersatzmaus @dalias Call me confused then.If there are no symbols, then how can external code dynamically link to it?The only way I can think of off the top of my head is a custom dynamic loader that has some magic secret.