One more question - the older version had a construct "DEFINED (.TOC.) ? .TOC. : ..." in case .TOC. is not defined (too old ld? too old gcc?) but the newer patch seems assuming it is always defined, when was it added? I have the same check in SLOF, for example, do I still need it?



On 10/03/2021 16:07, Alan Modra wrote:
On Wed, Mar 10, 2021 at 03:44:44PM +1100, Alexey Kardashevskiy wrote:
For my own education, is .got for prom_init.o still generated by ld or gcc?

.got is generated by ld.

In other words, should "objdump -D -s -j .got" ever dump .got for any .o
file, like below?

No.  "objdump -r prom_init.o | grep GOT" will tell you whether
prom_init.o *may* cause ld to generate .got entries.  (Linker
optimisations or --gc-sections might remove the need for those .got
entries.)

objdump: section '.got' mentioned in a -j option, but not found in any input
file

Right, expected.


--
Alexey Kardashevskiy
IBM OzLabs, LTC Team

e-mail: a...@linux.ibm.com

Reply via email to