Closed Cr0a3 closed 2 months ago
The error is only under windows (i tested it under linux and it worked fine)
It's using the wrong relocation kind. I never tested it under windows. It needs to be RelocationKind::SectionOffset
for references to other DWARF sections (so for RelocationTarget::Section
the resulting relocation type is IMAGE_REL_AMD64_SECREL
). You still need to use IMAGE_REL_AMD64_ADDR64
for RelocationTarget::Symbol
.
Changing to Dwarf64
is the wrong way to try to fix this. That is only needed when the DWARF sections are large. It has nothing to do with address size.
In general, when something like this doesn't work, the easiest way to figure out why it should be doing is to look at what gcc or clang generate.
Thank you that I fixed it.
Hi, I tried the simple write example: https://github.com/gimli-rs/gimli/blob/master/crates/examples/src/bin/simple_write.rs I ran it, got the object file. Then when i tried to compile it into an executable i got following errors:
So i gone ahed and changched the format from
Dwarf32
toDwarf64
. This time the linking actually worked. But then as i gone to test it in gdb. I got following error:My gcc is:
Bye