New contributor looking for a starting point in elf/ (dynamic linker)
김형원
hwkim568@gmail.com
Wed Oct 28 10:13:29 GMT 2026
Hi Adhemerval and Basile
Sorry for the late reply.
I looked at sysdeps/x86_64/tst-cet-legacy-*.c to see the existing test
cases in glibc.
tst-cet-legacy-4/5/6.c test the case where dlopen() rejects a legacy
.so (without IBT/SHSTK support).
However, tst-cet-legacy-1.c links a legacy .so at build time and only
checks that the call succeeds.
There isn't a test that checks a CET related failure in this case.
Is there a reason build-time linking doesn’t have a failure test like
dlopen does?
Is it because it's not possible to trigger a CET-related failure that way?
Thanks,
Hyungwon (HW)
2026년 8월 4일 (화) 오전 3:15, Adhemerval Zanella Netto
<adhemerval.zanella@linaro.org>님이 작성:
>
>
>
> On 30/07/26 20:55, 김형원 via Libc-help wrote:
> > Hi, I'm Hyungwon Kim.
> >
> > I'm interested in contributing to glibc.
> >
> > I've practiced writing syscalls and solved some ROP challenges from
> > pwn.college, so I know some things about the ELF file format and related
> > topics (ET_EXEC vs ET_DYN, etc).
> >
> > I cloned the glibc source and read a bit of code around elf/.
> >
> > I also read Patrick Horgan's post on how __libc_csu_init prepares for
> > main(), and got interested in how (csu/elf-init.c) was removed in glibc
> > 2.34 because it
> > contained a convenient ROP gadget which was exploitable with ret2csu.
> >
> > That made me curious how dynamic linkers handle program startup as well.
> >
> > I'd like to keep learning in that direction, but don't have a good sense of
> > which parts of elf/ (or the dynamic linker in general) are active and
> > approachable for a new contributor.
> >
> > Does anyone have a recommendation on where to look,
> > or something I could realistically work to patch on?
> Hi Hyungwon Kim,
>
> The elf/ contains the system generic shared between Hurd and Linux, each
> OS also have system-specific code at sysdeps (sysdeps/mach/ for Hurd and
> sysdeps/unix/sysv/linux for Linux). We also have the code at csu/, which
> is used for static-linking and process initialization.
>
> To understand to code better I would start at the elf/rtld.c, which is the
> main path for the dynamic loader (ld.so). It should give you a good
> understanding on how the dynamic-linking and process startup works.
>
> To a beginner I would recommend check on writing tests for elf/
> instead of jump into a bug and/or new feature. For instance, we have limited
> test for sotruss-lib.c + sotruss.sh, and chroot_canon.c, and for old format
> cache.c (just to name some on top on my mind).
>
> If you feel confident on work on patch, we have a somewhat long bug
> backlog [1]. Some recent issues are being worked, so you might check
> the patchwork [2] to either see if there is already a proposed fix.
>
> [1] https://sourceware.org/bugzilla/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=SUSPENDED&bug_status=WAITING&bug_status=REOPENED&component=dynamic-link&list_id=104448&product=glibc&query_format=advanced
> [2] https://patchwork.sourceware.org/project/glibc/list/
More information about the Libc-help
mailing list