#213 new
Peter Johnson

Invalid relocations for 32 bit DWARF2 in 64 bit Windows object files

Reported by Peter Johnson | June 25th, 2011 @ 07:52 PM

Originally posted on Trac by cag@absoft.com
Original Trac Ticket


Using DWARF2 debug information in 64 bit Windows object files causes the Microsoft linker shipped with Visual Studio 2008 (and later) to throw 'ADDR32' relocation invalid errors.

I can provide a .s file that contains the small amount of DWARF information needed to reproduce the error but here are the basics. The relocations that generate the errors are the 4 byte links between the DWARF2 sections, .debug_info to .debug_abbrev, .debug_info to .debug_line, etc.

In the assembly source (for example):

.section .debug_info

.byte 0x82, 0x00, 0x00, 0x00, 0x02, 0x00 .4byte .debug_abbrev

assembled into:

Offset Type Applied To Index Name

00000006 ADDR32 00000000 C .debug_abbrev

For this relocation, the Microsoft linker reports

1>t.obj : error LNK2017: 'ADDR32' relocation to '.debug_abbrev' invalid without /LARGEADDRESSAWARE:NO

Obviously, using /LARGEADDRESSAWARE:NO is useless for a 64 bit object file. There is an assumption that the total size of DWARF2 information will not exceed 2 gigabytes but there does not seem to be a way to get the Microsoft linker to accept this and I am not sure there is a solution short of generating full 64 bit DWARF3 information.

Would the IMAGE_REL_AMD64_SECREL (32-bit offset of the target from the beginning of its section) be a valid replacement for the current IMAGE_REL_AMD64_ADDR32 relocation?

Trac Attachments

Trac Comments

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Yasm Modular Assembler Project

Shared Ticket Bins

People watching this ticket