<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi,<br>
<br>
Currently lld ties up all atoms in a section for ELF together. This
proposal just breaks it by handling it differently.<br>
<br>
<b>This requires </b><b>NO ELF ABI changes.<br>
<br>
</b><u><b>Definitions :-</b></u><br>
<br>
A section is not considered safe if there is some code that appears
to be present between function boundaries (or) optimizes sections to
place data at the end or beginning of a section (that contains no
symbol).<br>
<br>
A section is considered safe if symbols contained within the section
have been associated with their appropriate sizes and there is no
data present between function boundaries.<br>
<br>
Examples of safe sections are, code generated by compilers.<br>
<br>
Examples of unsafe sections are, hand written assembly code.<br>
<br>
<u><b>Changes Needed :-</b></u><br>
<br>
The change that I am trying to propose is the compiler emits a
section, called (<b>.safe_sections) </b>that contains section
indices on what sections are safe.<br>
<br>
The section would have a SHF_EXCLUDE flag, to prevent other linkers
from consuming this section and making it to the output file.<br>
<br>
Data structure for this :-<br>
<br>
.safe_sections<br>
<total size> <br>
<section index> <boolean flag -- safe/unsafe><br>
...<br>
...<br>
<br>
<br>
<b><u>Advantages</u><br>
</b>There are advantages that the atoms within a safe section could
just be allocated in the output file which means better output file
layout, and Better performance!<br>
<br>
This would also result in more atoms getting gc'ed.<br>
<br>
a) looking at profile information<br>
b) taking a order file<br>
<br>
<b><u>Changes needed in the assembler</u><br>
<br>
</b>a) add an additional flag in the section for people writing
assembly code, to mark a section safe or unsafe.<br>
<b><br>
</b><b><u>Changes needed in lld</u><br>
<br>
</b>a) Read the safe section if its present in the object file<br>
b) Tie atoms together within a section if the section is not safe<br>
<b><br>
</b>Thanks<br>
<br>
Shankar Easwaran<b><br>
</b>
<pre class="moz-signature" cols="72">--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation</pre>
</body>
</html>