#135 ✓resolved
Peter Johnson

win64 .xdata section defaults

Reported by Peter Johnson | June 25th, 2011 @ 07:50 PM | in 1.2.0 (closed)

Originally posted on Trac by appro@fy.chalmers.se
Original Trac Ticket



If I want to compose Win64/x64 UNWIND_INFO structure myself and register custom language-specific exception [or termination] handler of own design, I'd have to

section .text
handler: ret
func:    ret
section .pdata
        dd func
        dd func_end
        dd myunwnd
section .xdata rdata align=8 nobase
myuwnd: db 9,0,0,0
        dd handler

I.e. nobase relocation is a must for handler. Now, rdata and align=8 are default and silently enforced, so I can omit them. But then one can argue that nobase should be enforced by default. But UNWIND_INFO can be followed by user-defined data and one can as well argue that some would like to reserve for nobase relocations there. In which case, if choice of nobase attribute for .xdata is left to developer, there should be a way to selectively generate nobase relocations. Possible suggestion is 'wrt ..imagebase' [suggested to nasm along with patch].

To summarize. If there is no way to selectively generate nobase relocations (e.g. with 'wrt ..imagebase'), then it's natural to enforce nobase on .xdata section (which should be explicitly documented so that developers know that nobase relocations is the only option if they want to append handler-specific data to UNWIND_INFO). A.

Trac Attachments

h3. Trac Comments

                    in reply to:
  ↑ description

              Changed 3 years ago by appro@fy.chalmers.se

For clarity sake I forgot to mention that .pdata section also requires 'nobase', as well as 'rdata' and 'align=4'. But one can omit all three, because all three are default and silently enforced for .pdata by yasm.

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