Commit Graph

9 Commits

Author SHA1 Message Date
Alan Modra
fd67aa1129 Update year range in copyright notice of binutils files
Adds two new external authors to etc/update-copyright.py to cover
bfd/ax_tls.m4, and adds gprofng to dirs handled automatically, then
updates copyright messages as follows:

1) Update cgen/utils.scm emitted copyrights.
2) Run "etc/update-copyright.py --this-year" with an extra external
   author I haven't committed, 'Kalray SA.', to cover gas testsuite
   files (which should have their copyright message removed).
3) Build with --enable-maintainer-mode --enable-cgen-maint=yes.
4) Check out */po/*.pot which we don't update frequently.
2024-01-04 22:58:12 +10:30
mengqinggang
d2fddb6d78 LoongArch: Fix ld "undefined reference" error with --enable-shared
Because _bfd_read_unsigned_leb128 is hidden visibility, so it can't
  be referenced out of shared object.

  The new function loongarch_get_uleb128_length just used to call
  _bfd_read_unsigned_leb128.

bfd/ChangeLog:

	* elfxx-loongarch.c (loongarch_get_uleb128_length): New function.
	* elfxx-loongarch.h (loongarch_get_uleb128_length): New function.

gas/ChangeLog:

	* config/tc-loongarch.c (md_apply_fix): Use
	loongarch_get_uleb128_length.
2023-06-16 17:32:02 +08:00
mengqinggang
1b6fccd28d LoongArch: bfd: Add support for linker relaxation.
Add relax support and related relocs in bfd.

bfd/ChangeLog:

	* bfd-in2.h: Add relocs related to relax.
	* elfnn-loongarch.c (struct loongarch_elf_link_hash_table): New integer
	pointer (data_segment_phase) to monitor the data segment phase.
	(loongarch_elf_check_relocs): Swap B21/B26 reloc sequence.
	(loongarch_elf_adjust_dynamic_symbol): Fix code format.
	(loongarch_reloc_rewrite_imm_insn): Fix function call.
	(perform_relocation): Handle new relocs related to relax.
	(RELOCATE_CALC_PC32_HI20): Fix code format.
	(RELOCATE_CALC_PC64_HI32): Likewise.
	(loongarch_elf_relocate_section): Handle new relocs related to relax.
	(loongarch_relax_delete_bytes): New function.
	(loongarch_relax_pcala_addi): Likewise.
	(loongarch_relax_pcala_ld): Likewise.
	(bfd_elfNN_loongarch_set_data_segment_info): Likewise.
	(loongarch_relax_align): Likewise.
	(loongarch_elf_relax_section): Likewise.
	(bfd_elfNN_bfd_relax_section): New macro define.
	* elfxx-loongarch.c (reloc_bits): New bfd point parameter.
	(reloc_bits_b16): Likewise.
	(reloc_bits_b21): Likewise.
	(reloc_bits_b26): Likewise.
	(loongarch_adjust_reloc_bitsfield): Likewise.
	(reloc_bits_pcrel20_s2): New function.
	(loongarch_elf_add_sub_reloc): Likewise.
	(loongarch_elf_add_sub_reloc_uleb128): Likewise.
	(loongarch_write_unsigned_leb128): New function.
	* elfxx-loongarch.h (loongarch_adjust_reloc_bitsfield): New bfd point
	parameter.
	(bfd_elf32_loongarch_set_data_segment_info): New declare.
	(bfd_elf64_loongarch_set_data_segment_info): Likewise.
	(loongarch_write_unsigned_leb128): Likewise.
	* libbfd.h: Add relocs related to relax.
	* reloc.c: Add relocs related to relax.
2023-05-30 19:56:41 +08:00
Alan Modra
d87bef3a7b Update year range in copyright notice of binutils files
The newer update-copyright.py fixes file encoding too, removing cr/lf
on binutils/bfdtest2.c and ld/testsuite/ld-cygwin/exe-export.exp, and
embedded cr in binutils/testsuite/binutils-all/ar.exp string match.
2023-01-01 21:50:11 +10:30
liuzhensong
6d13722a97 bfd: Add supported for LoongArch new relocations.
Define new reloc types according to linker needs.

  include/elf/
    loongarch.h

  bfd/
    bfd-in2.h
    libbfd.h
    reloc.c
    elfnn-loongarch.c
    elfxx-loongarch.c
    elfxx-loongarch.h
2022-07-25 09:59:08 +08:00
liuzhensong
d218dba3f4 LoongArch: Fix LD check fails.
Some test cases about ifunc.

  bfd/
    * elfnn-loongarch.c
    * elfxx-loongarch.h

   === ld Summary ===
  of expected passes             1430
  of expected failures           11
  of untested testcases          1
  of unsupported tests           154
2022-03-20 09:37:12 +08:00
liuzhensong
748594bc07 LoongArch: Use functions instead of magic numbers.
Replace the magic numbers in gas(tc-loongarch.c) and
  bfd(elfnn-loongarch.c) with the functions defined in
  the howto table(elfxx-loongarch.c).

  gas/
    * config/tc-loongarch.c: use functions.

  bfd/
    * elfnn-loongarch.c: use functions.
    * elfxx-loongarch.c: define functions.
    * elfxx-loongarch.h
2022-03-20 09:37:12 +08:00
Alan Modra
a2c5833233 Update year range in copyright notice of binutils files
The result of running etc/update-copyright.py --this-year, fixing all
the files whose mode is changed by the script, plus a build with
--enable-maintainer-mode --enable-cgen-maint=yes, then checking
out */po/*.pot which we don't update frequently.

The copy of cgen was with commit d1dd5fcc38ead reverted as that commit
breaks building of bfp opcodes files.
2022-01-02 12:04:28 +10:30
liuzhensong
e214f8db56 LoongArch bfd support
2021-10-22  Chenghua Xu  <xuchenghua@loongson.cn>
	    Zhensong Liu  <liuzhensong@loongson.cn>
	    Weinan Liu  <liuweinan@loongson.cn>
bfd/
	* Makefile.am: Add LoongArch.
	* archures.c: Likewise.
	* config.bfd: Likewise.
	* configure.ac: Likewise.
	* cpu-loongarch.c: New.
	* elf-bfd.h: Add LoongArch.
	* elf.c: Add LoongArch elfcore_grok_xxx.
	* elfnn-loongarch.c: New.
	* elfxx-loongarch.c: New.
	* elfxx-loongarch.h: New.
	* reloc.c: Add LoongArch BFD RELOC ENUM.
	* targets.c: Add LoongArch target.
	* Makefile.in: Regenerate.
	* bfd-in2.h: Regenerate.
	* configure: Regenerate.
	* libbfd.h: Regenerate.
	* po/BLD-POTFILES.in: Regenerate.
	* po/SRC-POTFILES.in: Regenerate.

include/
	* elf/common.h: Add NT_LARCH_{CPUCFG,CSR,LSX,LASX}.
	* elf/loongarch.h: New.
2021-10-24 21:36:31 +10:30