Subtracing addr is only appropriate for position-dependent objects,
where vaddrbase would also be the same value. For position-independent
objects, like the VDSO (which we already assume due to setting vaddrbase
to 0), the segments start at 0, not addr.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Before:
jrtc4@amoracia:~/freebsd-src$ LD_UTRACE=1 ktrace -t u /libexec/ld-elf.so.1 /usr/bin/true && kdump | grep loaded 6613 ld-elf.so.1 USER RTLD: loaded 0x47728f403408 @ 0x1dbb7f8e9000 - 0x1dbb7f8e8fff ([vdso]) 6613 ld-elf.so.1 USER RTLD: loaded 0x47728f403808 @ 0x1dbb7ff71000 - 0x1dbb80273fff (/lib/libc.so.7)
After:
jrtc4@amoracia:~/freebsd-src$ LD_UTRACE=1 ktrace -t u ~/freebsd-obj/home/jrtc4/freebsd-src/amd64.amd64/libexec/rtld-elf/ld-elf.so.1 /usr/bin/true && kdump | grep loaded 6607 ld-elf.so.1 USER RTLD: loaded 0x55e2a0a03408 @ 0x2e106a0ad000 - 0x2e106a0adfff ([vdso]) 6607 ld-elf.so.1 USER RTLD: loaded 0x55e2a0a03808 @ 0x2e106b725000 - 0x2e106ba27fff (/lib/libc.so.7)
libexec/rtld-elf/rtld.c | ||
---|---|---|
3034 | Why the round_page() is needed? |
libexec/rtld-elf/rtld.c | ||
---|---|---|
3034 | Because you can't have sub-page mappings? We round_page in digest_phdr. But maybe your point is that this a special sub-page-granularity object, unlike the ones we mmap from userspace? |
libexec/rtld-elf/rtld.c | ||
---|---|---|
3034 | Exactly. The vdso object itself only occupies parts of the shared page(s), there is other stuff co-located with it, like timehands, or rndg data. |
Comment Actions
Now:
jrtc4@amoracia:~/freebsd-src$ LD_UTRACE=1 ktrace -t u ~/freebsd-obj/home/jrtc4/freebsd-src/amd64.amd64/libexec/rtld-elf/ld-elf.so.1 /usr/bin/true && kdump | grep loaded 80756 ld-elf.so.1 USER RTLD: loaded 0x5a069ee03408 @ 0x3dae988c1000 - 0x3dae988c12e5 ([vdso]) 80756 ld-elf.so.1 USER RTLD: loaded 0x5a069ee03808 @ 0x3dae98deb000 - 0x3dae990edfff (/lib/libc.so.7)