News for hackers. Stuff that matters.
Re:Git 3.0 will use main as the default branch by 1718627440 on Monday November 24, 2025 @04:56PM (#46039868)
That's just the default. Nobody stops you from specifying `gcc -Wl,--entry,foo`.
Re:Git 3.0 will use main as the default branch by matheusmoreira on Monday November 24, 2025 @05:31PM (#46040170)
Standard C stops you. The C standard library is hardcoded to call the main function. Providing one's own ELF entry point also breaks libc initialization unless the exact same startfiles are used.

Freestanding C gets rid of the libc so that's not a problem.

Re:Git 3.0 will use main as the default branch by 1718627440 on Tuesday November 25, 2025 @03:49AM (#46043754)
Maybe you could also do some runtime linking trickery when dynamically linking libc?
Re:Git 3.0 will use main as the default branch by matheusmoreira on Wednesday November 26, 2025 @07:28PM (#46063976)
The libc could easily add support for such a thing but I doubt they'd care enough to. They'd probably see it as adding complexity for zero gain.

I submitted an issue to the GCC bugzilla about renaming certain symbols generated by compiler.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113694

I don't know how to implement it and nobody else cared enough to.