DWARF Standard


220427.1 Zoran Zaric Deprecate the DW_AT_segment attribute Enhancement Open Zoran Zaric

Section 2.12, pg 48

DW_AT_segment attribute was originally introduced in DWARF version 2 
as a way to support architectures which addresses are specified as 
offsets in a given segment rather than as a location within single 
flat address space.

Memory segmentation was originally implemented by Intel for their x86 
instruction set back in the 1978 as a way to allow programs to address 
more then 64 KB of memory.

However, for the last 19 years, Intel has not exposed this hardware 
feature to the user and it is mostly used implicitly by the instruction 
set or described by other means (TLS).

There is also no other known vendor that currently exposes this 
feature to the users, leaving this DWARF attribute potentially unneeded.

Additional confirmation to this claim, is the fact that widely used 
producer (clang) and consumers (gdb and lldb) never had support for 
DW_AT_segment attribute implemented.

There was the idea to repurpose the attribute to describe the address 
space concept of some architectures (for example SIMD/SIMT), but the 
problem is that memory segmentation and address spaces concepts are 
not similar enough and that representing address spaces requires a finer
level of granularity compared to the DIE level that DW_AT_segment 
attribute prescribes.

Proposed Change

In Section 2.12 (page 48) remove lines from line 2 to line 17.

Also, change the name of the Section 2.12 to "Address Classes"

In Table 5.1 (page 105) remove the reference to 2.12 Section at the
end of the table.

Even though the DW_AT_address_class attribute was introduced along 
side the DW_AT_segment attribute, there are existing architectures 
(Atmel AVR and FTDI FT32 32-bit for example) that are using that 
attribute to represent address space like features. Together with 
the fact that SIMD/SIMT architectures require a similar mechanism 
too, it would be reasonable to keep the DW_AT_address_class attribute as is.

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2007-2021 by DWARF Standards Committee.