tccelf: avoid find_section() for known section
commit312d28b0a8ab206601375606778e221985b130f7
authorgrischka <grischka>
Fri, 25 Nov 2022 10:58:29 +0000 (25 11:58 +0100)
committergrischka <grischka>
Fri, 25 Nov 2022 11:13:47 +0000 (25 12:13 +0100)
treee84caa93bf7b813699a8aaf129ef01f38ae729b8
parent28fa4d3db6aa74465cc49c5fac92e467b7f86899
tccelf: avoid find_section() for known section

- remove calls to "find_..." for stuff that we know to exist and where.
- rename find_section_create(s1,name,0) -> have_section(s1,name)

Also:
- call update_gnu_hash() from elf_output_file()

gnu_hasn() functions could be moved down into an already existing
!ELF_OBJ_ONLY clause, but in order to avoid too many diff lines
I didn't.

- avoid 'long' (elf_hash). sizeof (long) is host-dependent (4 or 8)
- remove unnecessary checks (for dynsym, versym).

Someone reading "if (dynsym == NULL) ..." must conclude that it
actually can happen under certain circumstances, or otherwise,
might conclude that the person who wrote that felt unsure what's
going on exactly.

arm64-gen.c:
 TCC_TARGET_MACHO instead of __APPLE__ (to support cross-compilers
 for the apple/M1 target)
arm64-gen.c
tccelf.c