> DWARF64 imposes
> some size overhead so not every ELF64 user wants to adopt DWARF64.
> DWARF64 serves a group of users who have large binaries which suffer
> from the 32-bit DWARF format limitation.
That says that DWARF64 has some important problems that needed
solving, which is undoubtedly true. I don't think it necessarily
says that using DWARF32, and then expecting 32 and 64 bit formats
to intermingle, was intended.
I recognize that you didn't cause this problem, and that now
you're holding the bag (a common fate for linker folks), and
trying to do something about it. If there is no better answer,
then I would go along with this section type (indeed, it's
better for Solaris that I do go along, if it happens). It seems
like a bandage on a mistake though, so I'm holding out hope
that someone can suggest a better more fundamental DWARF fix.
Personally, I'd prefer that ELF64 objects always use DWARF64,
and that these existing objects be fixed by recompilation. DWARF
bloat is a real problem, but surely the answer to that lies
in fixing DWARF, rather than having link-editors, and debuggers,
go through odd sorting and other workarounds?
- Ali
--
You received this message because you are subscribed to the Google Groups "Generic System V Application Binary Interface" group.
To unsubscribe from this group and stop receiving emails from it, send an email to generic-abi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/generic-abi/a81c1d94-fe4c-b588-7b57-6c55f9367c31%40Oracle.COM.
On 11/13/20 2:55 PM, 'Fāng-ruì Sòng' via Generic System V Application Binary Interface wrote:
> There is no requirement that ELF64 must use DWARF64.
I guess you mean that the dwarf spec doesn't explicitly
say ELF64 can't contain DWARF32? That might be true, but no spec
can explicitly list the universe of things that weren't intended
or anticipated. "No requirement" is not the same thing as "expected"
or "reasonable". In the absence of an explicit rule, why would anyone
assume that 64-bit objects can contain 32-bit content? These objects
violate expectations, if not the literal spec.
I'll stand down from that claim, and apologize, if you can point at
the place where the dwarf spec that says this is explicitly allowed.
--
H.J.
--
You received this message because you are subscribed to the Google Groups "Generic System V Application Binary Interface" group.
To unsubscribe from this group and stop receiving emails from it, send an email to generic-abi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/generic-abi/CAMe9rOo3BNexJQP84gm%3DTse9bPuqDYYthXYAHz7KRis6L13uJw%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Generic System V Application Binary Interface" group.
To unsubscribe from this group and stop receiving emails from it, send an email to generic-abi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/generic-abi/b67eb315-1595-37c4-387a-3b5668bc4767%40accesssoftek.com.
I’d like to continue this discussion. I don’t currently have permission to start a new conversation, so I’m replying here.
The 2020 discussion considered several possible approaches but did not reach a final ABI decision. The same problem has resurfaced in current LLVM/LLD work. When DWARF32 and DWARF64 input sections are mixed, DWARF32 contributions may be placed at high offsets within an output section, which can cause 32-bit relocations to overflow.
We are looking for an ELF-level producer–linker contract that allows the linker to order these contributions without parsing DWARF contents. The appropriate representation and scope remain open questions; the mechanism may need to apply beyond .debug_*, for example to .eh_frame.
The current LLVM RFC, which contains a concrete prototype, is available here:
Before moving further with the implementation, I would appreciate guidance on:
Whether this problem warrants a generic ELF ABI extension.
What representation and semantics would be appropriate.
How such a mechanism should remain compatible with existing linkers and consumers.
Thanks,
Liu Ke
There are threads discussing support mixed DWARF32 and DWARF64 input sections on llvm-dev[1] and binutils[2]. Let me summarize the problem:If a .debug_* output section S can be larger than 32-bit and its section offsetis referenced by a DWARF32 input section of itself or another .debug_* outputsection, the relocation may be subject to 32-bit relocation overflow(R_X86_64_32, R_PPC64_ADDR32, ...).In a link,... user_object_files libs.a libstdc++.a libc.a libc_nonshared.a libgcc.a libgcc_eh.a crtn.o crtend.oEven if user object files are all DWARF64, it may be impractical to ensure allthe system libraries/object files are DWARF64. Moreover, the linked librariesmay not all be DWARF64. When a user has relocation overflow problems, usuallytheir controlled object files and libraries dominate the total size, while thelinked libraries contribute a small portion but just that small portion cancause overflows if not ordered before DWARF64.For such linked libraries, shipping two copies DWARF32/DWARF64 seem to ask toomuch...So, there is a need to mitigate 32-bit relocation overflows by sorting DWARF32components before DWARF64 components within an output section. This worksfor most cases because the total size of DWARF32 components (non-user controlledpart) should be representable with 32-bit absolute relocation types (if not theuser really should recompile their prebuilt libraries;-))To sort DWARF32/DWARF64 components, a natural way is to assign DWARF64 sections anew section type (DWARF32 are SHT_PROGBITS) so that linker scripts/Solarismapfiles(? ASSIGN_SECTION TYPE=...) can know DWARF32/DWARF64 without checkingthe section contents (which is against the "smart format, dumb linker" spirit ofELF; practically, this can cause performance issues).So here is the request, can we (GNU binutils folks, LLVM folks, and stakeholdersof other operating systems) agree on a section type value? I shall add that thishas not been decided yet on binutils/LLVM sides (I've got ack from a seniorcontributor on LLVM debug info side, though) but I want to check whether it canget objection for other operating systems - the discussions on llvm-dev/binutilswill benefit from agreement/disagreement here.A DWARF specific probably does not have too much to do with ELF spec but theDWARF spec does not specify ELF specific stuff, either;-) So this list is mybest hope to get things standardized. Practically, LLVM is of my main concern:LLVM has Solaris support and I don't want Linux/*BSD/Solaris to gratuitouslydisagree on the section type values:)So, what do you think of allocating a value in the low range (like 19, 20, ...)?If you dislike it, can we pick a common value in the SHT_LOOS-SHT_HIOS range?I'd like the section type to be named SHT_DWARF64.As a GNU ld linker script example, with a type (and a to-be-determined section type matching keyword, once agreed upon), we can write.debug_info 0 : { *(TYPE (SHT_PROGBITS) .debug_info${RELOCATING+ .gnu.linkonce.wi.*}) *(TYPE (SHT_GNU_DWARF64) .debug_info) }