[PATCH 2/2] RISC-V: Merge ELF attribute for ld

Kito Cheng kito.cheng@gmail.com
Fri Dec 7 12:40:00 GMT 2018


This patch implement the RISC-V ELF attribute merge, only implement
exact arch version match now, we'll implement different merge policy
later.

ChangeLog:
bfd/
        * elfnn-riscv.c (in_subsets): New variable.
        (out_subsets): Likewise.
        (merged_subsets): Likewise.
        (riscv_std_ext_p): Likewise.
        (riscv_non_std_ext_p): Likewise.
        (riscv_std_sv_ext_p): Likewise.
        (riscv_non_std_sv_ext_p): Likewise.
        (riscv_version_mismatch): Likewise.
        (riscv_i_or_e_p): Likewise.
        (riscv_merge_std_ext): Likewise.
        (riscv_merge_non_std_and_sv_ext): Likewise.
        (riscv_merge_arch_attr_info): Likewise.
        (riscv_merge_attributes): Likewise.
        (riscv_elf_modify_segment_map): Likewise.
        (riscv_elf_additional_program_headers):  Likewise.
        (_bfd_riscv_elf_merge_private_bfd_data): Merge attribute.
        (elf_backend_additional_program_headers): Define as
        riscv_elf_additional_program_headers.
        (elf_backend_modify_segment_map): Define as
        riscv_elf_modify_segment_map.

binutils/
        * readelf.c (get_riscv_segment_type) New function.
        (get_segment_type): Add handler for RISC-V.

include/
        * elf/riscv.h (PT_RISCV_ATTRIBUTES): Define.

ld/
        * testsuite/ld-elf/orphan-region.d: XFAIL for RISC-V, because add new
        section.
        * testsuite/ld-scripts/size.exp: Unsupported size-2 for RISC-V,
        because RISC-V has new segment in PHDR.
        * testsuite/ld-riscv-elf/ld-riscv-elf.exp: Add new tests.
        * testsuite/ld-riscv-elf/attr-merge-arch-01.d: New test.
        * testsuite/ld-riscv-elf/attr-merge-arch-01a.s: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-arch-01b.s: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-arch-02.d: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-arch-02a.s: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-arch-02b.s: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-arch-03.d: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-arch-03a.s: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-arch-03b.s: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-arch-failed-01.d: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-arch-failed-01a.s: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-arch-failed-01b.s: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-priv-spec-a.s: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-priv-spec-b.s: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-priv-spec.d: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-stack-align-a.s: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-stack-align-b.s: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-stack-align-failed-a.s: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-stack-align-failed-b.s: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-stack-align-failed.d: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-stack-align.d: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-strict-align-01.d: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-strict-align-01a.s: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-strict-align-01b.s: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-strict-align-02.d: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-strict-align-02a.s: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-strict-align-02b.s: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-strict-align-03.d: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-strict-align-03a.s: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-strict-align-03b.s: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-strict-align-04.d: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-strict-align-04a.s: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-strict-align-04b.s: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-strict-align-05.d: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-strict-align-05a.s: Likewise.
        * testsuite/ld-riscv-elf/attr-merge-strict-align-05b.s: Likewise.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-RISC-V-Merge-ELF-attribute-for-ld.patch
Type: application/octet-stream
Size: 39932 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20181207/330cf48a/attachment.obj>


More information about the Binutils mailing list