xref: /aosp_15_r20/external/elfutils/TODO (revision 7304104da70ce23c86437a01be71edd1a2d7f37e)
1*7304104dSAndroid Build Coastguard Worker		      ToDo list for elfutils                      -*-outline-*-
2*7304104dSAndroid Build Coastguard Worker                      ----------------------
3*7304104dSAndroid Build Coastguard Worker
4*7304104dSAndroid Build Coastguard WorkerTime-stamp: <2009-02-05 22:08:01 drepper>
5*7304104dSAndroid Build Coastguard Worker
6*7304104dSAndroid Build Coastguard Worker* mkinstalldirs
7*7304104dSAndroid Build Coastguard Worker
8*7304104dSAndroid Build Coastguard Worker  Remove everywhere.  Use mkdir -p.
9*7304104dSAndroid Build Coastguard Worker
10*7304104dSAndroid Build Coastguard Worker* libelf:
11*7304104dSAndroid Build Coastguard Worker
12*7304104dSAndroid Build Coastguard Worker** verify section
13*7304104dSAndroid Build Coastguard Worker
14*7304104dSAndroid Build Coastguard Worker   Currently the elf_update function trusts the user blindly if the
15*7304104dSAndroid Build Coastguard Worker   ELF_F_LAYOUT flag is set.  This is OK if the data is prepared by a
16*7304104dSAndroid Build Coastguard Worker   ELF_C_NULL call but not if the user prepared the data herself
17*7304104dSAndroid Build Coastguard Worker
18*7304104dSAndroid Build Coastguard Worker** break out archive handling from elf_begin
19*7304104dSAndroid Build Coastguard Worker
20*7304104dSAndroid Build Coastguard Worker   The handling of archives (especially of the symbol tables) must be
21*7304104dSAndroid Build Coastguard Worker   broken out of elf_begin.  There are several different forms of
22*7304104dSAndroid Build Coastguard Worker   archives and only when having the archive handling separately this
23*7304104dSAndroid Build Coastguard Worker   remains maintainable.
24*7304104dSAndroid Build Coastguard Worker
25*7304104dSAndroid Build Coastguard Worker** shdrs in read-only files
26*7304104dSAndroid Build Coastguard Worker
27*7304104dSAndroid Build Coastguard Worker   When reading (ELF_C_READ*) then there is no need to malloc Shdr
28*7304104dSAndroid Build Coastguard Worker   structure in elfXX_getshdr if file is mmaped and unaligned access
29*7304104dSAndroid Build Coastguard Worker   is allowed or the structure is aligned.  Use ELF_F_MALLOCED flag
30*7304104dSAndroid Build Coastguard Worker   to differentiate.
31*7304104dSAndroid Build Coastguard Worker
32*7304104dSAndroid Build Coastguard Worker** shdrs after elf_cntl (ELF_C_FDREAD)
33*7304104dSAndroid Build Coastguard Worker
34*7304104dSAndroid Build Coastguard Worker   Similar to the above. After ELF_C_FDREAD the file is completely
35*7304104dSAndroid Build Coastguard Worker   in memory.  See also this mailing list thread:
36*7304104dSAndroid Build Coastguard Worker   https://fedorahosted.org/pipermail/elfutils-devel/2012-July/002368.html
37*7304104dSAndroid Build Coastguard Worker
38*7304104dSAndroid Build Coastguard Worker* libdw
39*7304104dSAndroid Build Coastguard Worker
40*7304104dSAndroid Build Coastguard Worker** More memory access checks needed
41*7304104dSAndroid Build Coastguard Worker
42*7304104dSAndroid Build Coastguard Worker   All accesses to the debug sections should make sure the offsets are
43*7304104dSAndroid Build Coastguard Worker   valid.  This is currently especially a problem with leb128 accesses.
44*7304104dSAndroid Build Coastguard Worker
45*7304104dSAndroid Build Coastguard Worker** Low level macro information operations
46*7304104dSAndroid Build Coastguard Worker
47*7304104dSAndroid Build Coastguard Worker   in 5.11.3 are not implemented.  gcc currently does not emit this
48*7304104dSAndroid Build Coastguard Worker   information so I cannot test it.
49*7304104dSAndroid Build Coastguard Worker
50*7304104dSAndroid Build Coastguard Worker** Rename dwarf_getabbrev
51*7304104dSAndroid Build Coastguard Worker
52*7304104dSAndroid Build Coastguard Worker
53*7304104dSAndroid Build Coastguard Worker* libcpu
54*7304104dSAndroid Build Coastguard Worker
55*7304104dSAndroid Build Coastguard Worker** x86
56*7304104dSAndroid Build Coastguard Worker
57*7304104dSAndroid Build Coastguard Worker*** Opcodes
58*7304104dSAndroid Build Coastguard Worker
59*7304104dSAndroid Build Coastguard Worker     crc32
60*7304104dSAndroid Build Coastguard Worker     extractps
61*7304104dSAndroid Build Coastguard Worker     pextrb
62*7304104dSAndroid Build Coastguard Worker     pextrd/pextrq
63*7304104dSAndroid Build Coastguard Worker     pextrw
64*7304104dSAndroid Build Coastguard Worker     pinsrq
65*7304104dSAndroid Build Coastguard Worker     popcnt 64-bit reg
66*7304104dSAndroid Build Coastguard Worker
67*7304104dSAndroid Build Coastguard Worker* nm:
68*7304104dSAndroid Build Coastguard Worker
69*7304104dSAndroid Build Coastguard Worker** add demangler support
70*7304104dSAndroid Build Coastguard Worker
71*7304104dSAndroid Build Coastguard Worker   Use demangler from libiberty.
72*7304104dSAndroid Build Coastguard Worker
73*7304104dSAndroid Build Coastguard Worker** add support to read debugging symbols
74*7304104dSAndroid Build Coastguard Worker
75*7304104dSAndroid Build Coastguard Worker   Implement -l option for BSD and POSIX format
76*7304104dSAndroid Build Coastguard Worker
77*7304104dSAndroid Build Coastguard Worker
78*7304104dSAndroid Build Coastguard Worker* strip:
79*7304104dSAndroid Build Coastguard Worker
80*7304104dSAndroid Build Coastguard Worker** support SHT_SYMTAB_SHNDX
81*7304104dSAndroid Build Coastguard Worker
82*7304104dSAndroid Build Coastguard Worker   should be removed if not needed anymore
83*7304104dSAndroid Build Coastguard Worker
84*7304104dSAndroid Build Coastguard Worker* ld:
85*7304104dSAndroid Build Coastguard Worker
86*7304104dSAndroid Build Coastguard Worker** sanity check .rel sh_info content
87*7304104dSAndroid Build Coastguard Worker
88*7304104dSAndroid Build Coastguard Worker   the sh_info of all .rel sections with the same name must point to
89*7304104dSAndroid Build Coastguard Worker   sections which also have the same name
90*7304104dSAndroid Build Coastguard Worker
91*7304104dSAndroid Build Coastguard Worker** use ld.so.conf
92*7304104dSAndroid Build Coastguard Worker
93*7304104dSAndroid Build Coastguard Worker   to locate shared libraries also use /etc/ld.so.conf
94*7304104dSAndroid Build Coastguard Worker
95*7304104dSAndroid Build Coastguard Worker** handle object files for different architectures
96*7304104dSAndroid Build Coastguard Worker
97*7304104dSAndroid Build Coastguard Worker   ld.so is expected to ignore object files for different architectures and
98*7304104dSAndroid Build Coastguard Worker   continue looking for a matching file (e.g., ignore 32-bit binaries on
99*7304104dSAndroid Build Coastguard Worker   64-bit platforms and vice versa).  We probably need the same in ld.
100*7304104dSAndroid Build Coastguard Worker
101*7304104dSAndroid Build Coastguard Worker** reuse after elf_end
102*7304104dSAndroid Build Coastguard Worker
103*7304104dSAndroid Build Coastguard Worker   Some files are closed using elf_end.  They are removed from memory only
104*7304104dSAndroid Build Coastguard Worker   if no reference is left (especially for archives this is a problem).
105*7304104dSAndroid Build Coastguard Worker   The old mapping should be reused in that case.  The problem is worse
106*7304104dSAndroid Build Coastguard Worker   for files which are not mapped read-only (archives again).
107*7304104dSAndroid Build Coastguard Worker
108*7304104dSAndroid Build Coastguard Worker** size for STT_SECTION entries
109*7304104dSAndroid Build Coastguard Worker
110*7304104dSAndroid Build Coastguard Worker   The STT_SECTION entries have zero for the size but can easily get
111*7304104dSAndroid Build Coastguard Worker   the size of the section.
112*7304104dSAndroid Build Coastguard Worker
113*7304104dSAndroid Build Coastguard Worker** .eh_frame_hdr
114*7304104dSAndroid Build Coastguard Worker
115*7304104dSAndroid Build Coastguard Worker   Not implemented at all in the moment except for recognition of the option
116*7304104dSAndroid Build Coastguard Worker   itself.
117*7304104dSAndroid Build Coastguard Worker
118*7304104dSAndroid Build Coastguard Worker** variables with aliases in executables
119*7304104dSAndroid Build Coastguard Worker
120*7304104dSAndroid Build Coastguard Worker   When linking an executable with a references against a variable in a
121*7304104dSAndroid Build Coastguard Worker   DSO, create symbol table entries for all the aliases of the variable
122*7304104dSAndroid Build Coastguard Worker   in the DSO and create a relocation for one of them (a non-weak
123*7304104dSAndroid Build Coastguard Worker   definition)
124*7304104dSAndroid Build Coastguard Worker
125*7304104dSAndroid Build Coastguard Worker* elflint
126*7304104dSAndroid Build Coastguard Worker
127*7304104dSAndroid Build Coastguard Worker** additional checks
128*7304104dSAndroid Build Coastguard Worker
129*7304104dSAndroid Build Coastguard Worker   1st GOT entry == _DYNAMIC
130*7304104dSAndroid Build Coastguard Worker
131*7304104dSAndroid Build Coastguard Worker   check versioning info:
132*7304104dSAndroid Build Coastguard Worker
133*7304104dSAndroid Build Coastguard Worker     always BASE in verdef
134*7304104dSAndroid Build Coastguard Worker     sh_size/sh_entsize matches last offset != 0
135*7304104dSAndroid Build Coastguard Worker
136*7304104dSAndroid Build Coastguard Worker   check whether any relocation is for a merge-able section
137*7304104dSAndroid Build Coastguard Worker
138*7304104dSAndroid Build Coastguard Worker   check TLS relocation dependencies
139*7304104dSAndroid Build Coastguard Worker
140*7304104dSAndroid Build Coastguard Worker   Check content of .eh_frame_hdr, .eh_frame, .gcc_except_table
141*7304104dSAndroid Build Coastguard Worker
142*7304104dSAndroid Build Coastguard Worker*** for x86
143*7304104dSAndroid Build Coastguard Worker
144*7304104dSAndroid Build Coastguard Worker    check that R_386_TLS_GD is followed by R_386_PLT32 for __tls_get_addr
145*7304104dSAndroid Build Coastguard Worker
146*7304104dSAndroid Build Coastguard Worker** relax
147*7304104dSAndroid Build Coastguard Worker
148*7304104dSAndroid Build Coastguard Worker   prelink generated files
149*7304104dSAndroid Build Coastguard Worker
150*7304104dSAndroid Build Coastguard Worker* elfcmp
151*7304104dSAndroid Build Coastguard Worker
152*7304104dSAndroid Build Coastguard Worker** treat relocation sections special
153*7304104dSAndroid Build Coastguard Worker
154*7304104dSAndroid Build Coastguard Worker   Differences in the relocation sections can be ignored if all
155*7304104dSAndroid Build Coastguard Worker   the same symbols with the same targets are present and the order
156*7304104dSAndroid Build Coastguard Worker   of overlapping relocations doesn't change.  There really never
157*7304104dSAndroid Build Coastguard Worker   should be overlapping relocations but who knows.
158*7304104dSAndroid Build Coastguard Worker
159*7304104dSAndroid Build Coastguard Worker* mcs
160*7304104dSAndroid Build Coastguard Worker
161*7304104dSAndroid Build Coastguard Worker  Sun has it.  Can modify sections which are not in segments.
162*7304104dSAndroid Build Coastguard Worker
163*7304104dSAndroid Build Coastguard Worker     -a string
164*7304104dSAndroid Build Coastguard Worker           Append string to the comment section of the ELF object
165*7304104dSAndroid Build Coastguard Worker           files. If  string contains embedded blanks, it must be
166*7304104dSAndroid Build Coastguard Worker           enclosed in quotation marks.
167*7304104dSAndroid Build Coastguard Worker
168*7304104dSAndroid Build Coastguard Worker     -c    Compress the contents of the comment  section  of  the
169*7304104dSAndroid Build Coastguard Worker           ELF  object  files. All duplicate entries are removed.
170*7304104dSAndroid Build Coastguard Worker           The ordering of the  remaining  entries  is  not  dis-
171*7304104dSAndroid Build Coastguard Worker           turbed.
172*7304104dSAndroid Build Coastguard Worker
173*7304104dSAndroid Build Coastguard Worker     -d    Delete the contents of the comment  section  from  the
174*7304104dSAndroid Build Coastguard Worker           ELF  object  files. The section header for the comment
175*7304104dSAndroid Build Coastguard Worker           section is also removed.
176*7304104dSAndroid Build Coastguard Worker
177*7304104dSAndroid Build Coastguard Worker     -n name
178*7304104dSAndroid Build Coastguard Worker           Specify the name of the comment section to  access  if
179*7304104dSAndroid Build Coastguard Worker           other  than  .comment.  By default, mcs deals with the
180*7304104dSAndroid Build Coastguard Worker           section named .comment. This option  can  be  used  to
181*7304104dSAndroid Build Coastguard Worker           specify  another  section.  mcs  can  take multiple -n
182*7304104dSAndroid Build Coastguard Worker           options to allow for specification of   multiple  sec-
183*7304104dSAndroid Build Coastguard Worker           tion comments.
184*7304104dSAndroid Build Coastguard Worker
185*7304104dSAndroid Build Coastguard Worker     -p    Print the contents of the comment section on the stan-
186*7304104dSAndroid Build Coastguard Worker           dard  output.  Each  section  printed is tagged by the
187*7304104dSAndroid Build Coastguard Worker           name of the file from which it  was  extracted,  using
188*7304104dSAndroid Build Coastguard Worker           the  format  file[member_name]:  for archive files and
189*7304104dSAndroid Build Coastguard Worker           file:  for other files.
190*7304104dSAndroid Build Coastguard Worker
191*7304104dSAndroid Build Coastguard Worker     -V    Print on standard error the version number of mcs.
192*7304104dSAndroid Build Coastguard Worker
193*7304104dSAndroid Build Coastguard WorkerLocal Variables:
194*7304104dSAndroid Build Coastguard Workereval:(hide-sublevels 3)
195*7304104dSAndroid Build Coastguard WorkerEnd:
196