by fcambus on 4/12/23, 8:09 AM with 39 comments
by JonChesterfield on 4/12/23, 9:45 AM
> It seems obvious that on 32-bit and 64-bit systems, the function should not give different results
and a commit to mask off the low bits in an implementation elsewhere.
Well, maybe that would be convenient, but overall it seems unimportant. It's necessary for the tool writing the table and the tool reading it to agree but cross compilation is absolutely full of hazards like this anyway.
The code looks fine to me for what that's worth. I can see the assignment in the if being contentious.
by userbinator on 4/12/23, 1:32 PM
h = (h << 4) + *name++;
But as one should know, two n-bit numbers can create an n+1-bit result when added due to carry.by gumby on 4/12/23, 4:56 PM
I remember thinking at the time that it was an oversight but it took more than another decade for that to even matter.
by omginternets on 4/12/23, 2:20 PM
I would like to to beyond my current understanding, which is basically “they’re effectively one-way functions”, and be able to participate in discussions of articles such as this one.
by Toxide on 4/12/23, 2:28 PM
by lionkor on 4/12/23, 8:46 AM
As always in C programming, the bugs arise from people doing stuff that any sane guideline tells them to not do.
by sylware on 4/12/23, 10:29 AM
We should start to deprecate DT_NEEDED and make dlopen/dlsym/dlclose (maybe, dlvsym) hard symbols in the loader.
And game devs should stop using main() as some genius glibc dev did add a new libc_start_main version in 2.34. Namely, any game executable linked with a glibc from 2.34 will refuse to load on system with a previous glibc.
Actually, game binaries should be pure ELF64 binaries (not using main()) which "libdl" (dlopen/dlsym/dlclose) everything they need from the system. And of course, as much as possible should be statically linked (I think this is what unity is doing, but unreal/godot have a big issue: the static libstdc++ which, as of late, does not libdl anything from the system).