Path: ...!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: BGB Newsgroups: comp.lang.c Subject: Re: C23 thoughts and opinions Date: Fri, 7 Jun 2024 10:20:39 -0500 Organization: A noiseless patient Spider Lines: 36 Message-ID: References: <20240530170836.00005fa0@yahoo.com> <20240530180345.00003d9f@yahoo.com> <20240531161937.000063af@yahoo.com> <20240531162811.00006719@yahoo.com> <20240531164835.00007128@yahoo.com> <20240531173437.00003bee@yahoo.com> <22r6O.5934$xPJ1.2590@fx09.iad> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Fri, 07 Jun 2024 17:21:51 +0200 (CEST) Injection-Info: dont-email.me; posting-host="bcd181c8a8249ff7c60382eea8a36cf2"; logging-data="2235091"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+4LygUttTJ4wP6pcd9wGjRUu2DUA8FAIo=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:8wYVgH2+hC6yUp7cZJCohKHFzP8= Content-Language: en-US In-Reply-To: Bytes: 2847 On 6/7/2024 4:04 AM, Lawrence D'Oliveiro wrote: > On Fri, 7 Jun 2024 00:51:22 -0500, BGB wrote: > >> Generally, using ELF32 on 64-bit targets isn't a thing... > > It might have been, if Intel’s promotion of an “X32” ABI (keeping > addresses at 32 bits, but using the extra instructions for the increased > register set) for AMD64 had taken off. Even the Linux kernel supported it, > at one point. But nobody seemed to care. Not like X32, but like: Use 32-bit members in the ELF files, but 64-bit relocs and addresses for the program itself. Arguably, if you don't need the program image itself to be larger than 4GB, you don't need 64-bit addresses to things within the ELF metadata. Or, basically, they could have gone the route that PE/COFF had went, and had more compact metadata. We have 24 byte symbols and relocs, because: 8b: Address of Symbol/Reloc 8b: Type + Symbol Index 8b: Addend or String-Table Address In PE/COFF, they typically use "RVA's" (relative virtual address), which are always 32-bits even if the program itself is 64-bit. Would be an issue if one wanted a PE/COFF image where the combined section sizes exceeded 4GB, but this isn't really a thing at present... But, alas...