<davidlt[m]>
scanelf: scanelf_file_textrels(): ELF ./usr/lib/systemd/systemd-logind has TEXTREL markings but doesnt appear to have any real TEXTREL's !?
<zbyszek[m]>
Looks all normal. The code is compiled with -fPIC. systemd-logind is actually executed at least twice during the build: there's a dist-check-style check for --help, and the dbus interface is exported.
<davidlt[m]>
The problem is that I have seen this issue before, and I see it in my notes from years (not sure if systemd related). I have no memory what I did about it :)
<davidlt[m]>
So it's time to rediscover :D
<davidlt[m]>
In general the problem is simple, .text is not writable. binutils generates TEXTREL and dynamic loader cannot do anything about it.
<davidlt[m]>
Thus resulting in:
<davidlt[m]>
[ 2123.613276] systemd-logind[1393]: /usr/lib/systemd/systemd-logind: error while loading shared libraries: cannot make segment writable for relocation: Operation not permitted
<davidlt[m]>
```
<davidlt[m]>
```
<davidlt[m]>
Fun fact, running /usr/lib/systemd/systemd-logind manually (as root) seems to work (?).
<davidlt[m]>
So is it:
<davidlt[m]>
2. binutils acting up and generating wrong TEXTREL (not the 1st time, there is a ticket open for riscv64 [and other arches] about it
<davidlt[m]>
3. capabilities
<davidlt[m]>
1. Missing PROT_WRITE or something similar somewhere
<davidlt[m]>
Well, it could be also 4. SELinux blocking it
<davidlt[m]>
Somehow I bet on binutils bug for now.
<zbyszek[m]>
How is 3.capabiliies related?
<davidlt[m]>
Because running as root seems to work (well, I don't have exact environment as what's inside system daemon). systemd-logind.service lists a bunch of capabilities, so it's limited.
<zbyszek[m]>
Yeah, but are caps related to linking in any way?
<davidlt[m]>
It shouldn't, unless there is something that blocks writing to memory.
<davidlt[m]>
Because running as root (without all other stuff in systemd service file) seemed to work fine.
<davidlt[m]>
Again, not the same environment.
<davidlt[m]>
But again scanelf also says TEXTREL exist (the flag), but has no actual TEXTRELs.
<davidlt[m]>
Rebuilding with 2.39 binutils is relatively fast test and cheap :) So let's wait a bit, get the morning coffee/tea in.
<davidlt[m]>
Let the brain boot up properly ☕️
<davidlt[m]>
I also looked as known working systemd build, and there are no TEXTRELs.
<davidlt[m]>
I bet everyone forgot about it, especially since Jim left.
<davidlt[m]>
On OpenEmbedded/Yoct side were is a QA check that looks for textrels.
<davidlt[m]>
Something like:
<davidlt[m]>
ERROR: QA Issue: ELF binary '/work/i586-oe-linux/glide/0.13.1-r0/packages-split/glide/usr/bin/glide' has relocations in .text [textrel]
<davidlt[m]>
```
<davidlt[m]>
```
<davidlt[m]>
I keep seeing harderings and textrels in the same context a lot more.
jcajka has joined #fedora-riscv
tg has quit [Quit: tg]
rwmjones has quit [Read error: Connection reset by peer]
rwmjones has joined #fedora-riscv
<davidlt[m]>
21 minutes, 13.1.1-1, in gcc.spec :)
<davidlt[m]>
Seems that binutils 2.39 is also generating TEXTREL
<davidlt[m]>
TYPE TEXTRELS FILE
<davidlt[m]>
scanelf: scanelf_file_textrels(): ELF ./usr/lib/systemd/systemd-logind has TEXTREL markings but doesnt appear to have any real TEXTREL's !?