A new feature I want to add to ld, I need someone to point me in the right direction

Jonathan Wilson jonwil@tpgi.com.au
Mon Oct 13 00:07:00 GMT 2003


Basicly, the Visual C++ linker supports a feature that I want to implement 
in GNU LD (more specificly win32 PE builds of GNU LD).
The feature works like so:
Firstly, the linker will interperate any segnemt names containing a $ 
(where ? is anything) as being named as though the $ and any text after it 
didnt exist (i.e. .tls$ becomes .tls and .tls$ZZZ becomes .tls).
The information after the $ is then used to controll the order that the 
sections get written out. First comes anything with no $ (i.e. all the 
sections named .tls) then anything with a $ but no text after the $ (i.e. 
all the sections named .tls$) then comes all the sections with a $ and text 
(so .tls$AAA comes after .tls$ but before .tls$ZZZ)

Example of how sections would be output:
.tls
.tls$
.tls$ABC
.tls$DEF
.tls$ZZZ
The above sections would be output in the above order and would be combined 
into one segment named .tls

I want to implement this because it is necessary to support win32 Thread 
Local Storage (as implemented by Microsoft in Visual C++ and in the windows 
kernel)




More information about the Binutils mailing list