#140 (win64 .xdata section defaults) – The Yasm Modular Assembler Project

Ticket #140 (new defect)

Opened 22 months ago

Last modified 22 months ago

win64 .xdata section defaults

Reported by: appro@… Owned by:
Priority: P1 Milestone:
Component: Core Version: 0.6.0
Severity: normal Keywords:
Cc:

Description

Hi,

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
func_end:
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.

Attachments

Change History

comment:1 in reply to: ↑ description Changed 22 months ago by appro@…

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.

Add/Change #140 (win64 .xdata section defaults)

Author



Action
as new
 
Note: See TracTickets for help on using tickets.