Hi, 
I did some experiments to convert cross-reference table
to resolution files. Patches are attached and still crude. 

The initial idea is to have as little as possible change 
in GNU LD. It turns out that cross reference table doesn't
always print out definition at the first line. So 
some change is needed there. In addition, offset within 
archive file is also useful. Nonetheless, such changes
may break existing cref users. Maybe it is better to dump
to a different file. 

Collect2 is modified to convert the enhanced cross-reference
table to a full resolution file and used it in subsequent
linking steps. Maybe I can move this part into LD. I am just
not sure if it is easy to have similar functions in BFD
as those in libelf. And it will be a much bigger change on
GNU LD then. 

I have tried with small examples, and our mixed C/assembly
applications. It works well with -flto/-fwhole-program. 

Any opinion on this approach? 

Thanks,
Bingfeng

Attachment: patch_collect2
Description: patch_collect2

Attachment: patch_ld
Description: patch_ld

Reply via email to