From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 38292 invoked by alias); 26 Feb 2018 08:36:30 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 38214 invoked by uid 89); 26 Feb 2018 08:36:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,HTML_MESSAGE,HTML_OBFUSCATE_05_10,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wr0-f193.google.com Received: from mail-wr0-f193.google.com (HELO mail-wr0-f193.google.com) (209.85.128.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 26 Feb 2018 08:36:19 +0000 Received: by mail-wr0-f193.google.com with SMTP id v111so8014081wrb.3 for ; Mon, 26 Feb 2018 00:36:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=tlwZ4N21MrGPhHy5CspobIeI40oAZKYenKHtdRLQnV8=; b=M/4fgO1r+OiKCgFBia43WIng18UU8LLPt5rIFEVsKwVBQjSkz+kyriTBQES8anvP7z NK+t9aFNZPsEYH7ElEEZvOlMeFoxHmera+D00hIyfeNaQxzggJ5qh69I2Z756GcphGEy LmYngtW6uW9fBXTjoO1ZwMcXWbmeddPxgl3Np/oXA6iGbl53CiUE2f5J3EkBi1gMJ2AI 5wGvamO+jkcPZNAwtH5hUXwmxhNz5YzaZSTJLlMyIE3CKRdGRPhgMh4QSNFkKtqyN5gX lf6caQHM7UO+h1/Z5xPHdfSF3E7Ve1FmBE8GA5M3KqxkrwkM86LSnDRl/AZvKrlGEaC6 I4Eg== X-Gm-Message-State: APf1xPB1Ra/ysNAcBnu8HP5Yv+WeQinnZQsN8pc+INevjsZWxnoKwe+X Ce96zjpc+3XCZN041jnlqobgMMu9ClqH0ezSfzg= X-Google-Smtp-Source: AH8x225ZX4zOq3IbrfcaGNomc5LwZj370z6HrMcM0vqI1j/jslpgy4WrzeHINsSHq571Sx7LSeww2HV9TS/c6XC04TY= X-Received: by 10.223.201.15 with SMTP id m15mr7974621wrh.54.1519634176861; Mon, 26 Feb 2018 00:36:16 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.178.66 with HTTP; Mon, 26 Feb 2018 00:36:16 -0800 (PST) In-Reply-To: References: From: Andrew Sadek Date: Mon, 26 Feb 2018 08:36:00 -0000 Message-ID: Subject: Re: [PATCH] [Microblaze]: PIC Data Text Relative To: gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org Cc: Michael Eager , nmekala@xilinx.com Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2018-02/txt/msg00377.txt.bz2 Change logs below. There is a problem in attaching the bundle. I get permanent error from sourceware.org GCC ChangeLog: Microblaze Target: PIC data text relative * gcc/config/microblaze/microblaze.opt: add new option -mpic-data-text-rel. * gcc/config/microblaze/microblaze-protos.h (microblaze_constant_address_p ): Add microblaze_constant_address_p function instead of the macro in microblaze.h * gcc/config/microblaze/microblaze.c (TARGET_PIC_DATA_TEXT_REL): New addressing mode for data-text relative position indepenedent code. (microblaze_classify_unspec): add 'UNSPEC_TEXT' case -> 'ADDRESS_SYMBOLIC_TXT_REL'. (microblaze_classify_address): add handling for UNSPEC + CONST_INT. (microblaze_legitimate_pic_operand): exclude function calls from pic operands in case of TARGET_PIC_DATA_TEXT_REL option. (microblaze_legitimize_address): generate 'UNSPEC_TEXT' for all possible addresses cases. (microblaze_address_insns): add 'ADDRESS_SYMBOLIC_TXT_REL' case. (print_operand): add 'ADDRESS_SYMBOLIC_TXT_REL' case. (print_operand_address): add 'ADDRESS_SYMBOLIC_TXT_REL' case + handling for 'address + offset'. (microblaze_expand_prologue): add new function prologue call for 'r20' assignation. (microblaze_asm_generate_pic_addr_dif_vec): override new target hook 'TARGET_ASM_GENERATE_PIC_ADDR_DIFF_VEC' to disable address diff vector table in case of TARGET_PIC_DATA_TEXT_REL. (expand_pic_symbol_ref): add handling for 'UNSPEC_TEXT'. * gcc/config/microblaze/microblaze.md (TARGET_PIC_DATA_TEXT_REL): Add new macros 'UNSPEC_TEXT', 'UNSPEC_SET_TEXT' + add rule for setting r20 in function prologue + exclude function calls from 'UNSPEC_PLT' in case of data text relative mode. * gcc/doc/tm.texi.in (TARGET_ASM_GENERATE_PIC_ADDR_DIFF_VEC): Add new target hook for generating address diff vector tables in case of flag_pic. * gcc/doc/tm.texi : Regenerate. * gcc/stmt.c (TARGET_ASM_GENERATE_PIC_ADDR_DIFF_VEC): append new condition 'targetm.asm_out.generate_pic_addr_diff_vec' to flag_pic in case of addr diff vector generation. * gcc/target.def (TARGET_ASM_GENERATE_PIC_ADDR_DIFF_VEC): add target hook definition. * gcc/targhooks.h, gcc/targhooks.c (TARGET_ASM_GENERATE_PIC_ADDR_DIFF_VEC): add default function for generate_pic_addr_diff_vec -> flag_pic. Binutils ChangeLog: Microblaze Target: PIC data text relative * include/elf/microblaze.h (Add 3 new relocations): 'R_MICROBLAZE_TEXTPCREL_64', 'R_MICROBLAZE_TEXTREL_64' and 'R_MICROBLAZE_TEXTREL_32_LO' for relax function. * bfd/bfd-in2.h, bfd/libbfd.h (2 new BFD relocations): 'BFD_RELOC_MICROBLAZE_64_TEXTPCREL' + 'BFD_RELOC_MICROBLAZE_64_TEXTPCREL' * bfd/elf32-microblaze.c (Handle new relocs): define 'HOWTO' of 3 new relocs and handle them in both relocate and relax functions. (microblaze_elf_reloc_type_lookup): add mapping between for new bfd relocs. (microblaze_bfd_write_branch_absolute_value_64): replace relative branch with absolute in case 'adjust_insn_abs_refs' is true (microblaze_bfd_revert_base_reg_value_64): revert base register from r20 to r0 in case 'adjust_insn_abs_refs' is true (microblaze_elf_relocate_section): Handle new relocs in case of elf relocation. (microblaze_elf_relax_section): Handle new relocs for elf relaxation. * gas/config/tc-microblaze.c (Handle new relocs directives in assembler): Handle new relocs from compiler output. (imm_types): add new imm types for data text relative addressing 'TEXT_OFFSET', 'TEXT_PC_OFFSET' (md_convert_frag): conversion for 'BFD_RELOC_MICROBLAZE_64_TEXTPCREL' , 'BFD_RELOC_MICROBLAZE_64_TEXTPCREL' (md_apply_fix): apply fix for 'BFD_RELOC_MICROBLAZE_64_TEXTPCREL' , 'BFD_RELOC_MICROBLAZE_64_TEXTPCREL' (md_estimate_size_before_relax): estimate size for 'BFD_RELOC_MICROBLAZE_64_TEXTPCREL' , 'BFD_RELOC_MICROBLAZE_64_TEXTPCREL' (tc_gen_reloc): generate relocations for 'BFD_RELOC_MICROBLAZE_64_TEXTPCREL' , 'BFD_RELOC_MICROBLAZE_64_TEXTPCREL' Add new linker options for static linking: adjust-insn-abs-refs, disable-multiple-abs-defs * ld/lexsup.c (Add 2 ld options): (ld_options): add adjust-insn-abs-refs, disable-multiple-abs-defs @ 'ld_options' array (parse_args): parse options and pass flags to 'link_info' struct. * ld/ldlex.h (Add 2 enums): add new enums @ 'option_values' enum. * include/bfdlink.h (Add 2 flags): Add new flags @ 'bfd_link_info' struct. * ld/main.c: Initialize flags with false @ 'main'. Handle disable-multiple-abs-defs @ 'mutiple_definition'. On Mon, Feb 26, 2018 at 9:56 AM, Andrew Guirguis wrote: > Dears, > > Kindly find the patch bundle for Microblaze '-mpic-data-text-relative' > feature at the following link: > https://github.com/andrewsadek/microblaze-pic-data-text-rel/ > tree/pic_data_text_rel/PATCH%20BUNDLE > > Description of the feature: > https://github.com/andrewsadek/microblaze-pic-data-text-rel/ > blob/pic_data_text_rel/README.md > > Bundle includes: > 1) Change logs for GCC, binutils > 2) GCC Test results and comparison with the original. > 3) New Test case (picdtr.c) > 4) The Patches (against current heads) > > Thanks > > -- > > Andrew > -- Andrew