On Mär 09 2023, Sergey Bugaev wrote: > x86_64-gnu-gcc -nostdlib -nostartfiles -r -o elf/librtld.map.o > elf/librtld.mapT.o '-Wl,-(' elf/dl-allobjs.os libc_pic.a > mach/libmachuser_pic.a hurd/libhurduser_pic.a -lgcc '-Wl,-)' > -Wl,-Map,elf/librtld.mapT > x86_64-gnu/bin/ld: libc_pic.a(_exit.os): in function `__GI__exit': > posix/../sysdeps/mach/hurd/_exit.c:50: multiple definition of `__GI__exit'; > elf/dl-allobjs.os:elf/../sysdeps/mach/hurd/dl-sysdep.c:728: first defined > here
The only symbol provided by _exit.os that is not defined by ../sysdeps/mach/hurd/dl-sysdep.c is _Exit. Does anything call this function? > x86_64-gnu/bin/ld: libc_pic.a(strtoul.os): in function > `__GI___strtoul_internal': > stdlib/../sysdeps/wordsize-64/strtoul.c:108: multiple definition of > `__GI___strtoul_internal'; > elf/dl-allobjs.os:elf/../sysdeps/mach/hurd/dl-sysdep.c:713: first defined > here Similarily, something is pulling in strtoul.os because it references a symbol from there not defined by ../sysdeps/mach/hurd/dl-sysdep.c. elf/librtld.mapT should tell you where the references come from. > 1. What is this about, what's it even trying to do? If this is linking the > dynamic linker (ld.so / rtld — these are the same thing, right?), then why > does it need the dl-sysdep version if the real version is available? The comments in ../sysdeps/mach/hurd/dl-sysdep.c indicate that the dynamic linker wants to use some stripped down implementation of these functions. > 3. How come this works on i686-gnu, the duplicated symbols are clearly > present there too! Pure luck, perhaps. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."