Skip to content

microblaze: apply binutils patches from meta-xilinx repository #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: zephyr-binutils-2_38
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bfd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,7 @@ BFD64_BACKENDS = \
elf64-riscv.lo \
elfxx-riscv.lo \
elf64-s390.lo \
elf64-microblaze.lo \
elf64-sparc.lo \
elf64-tilegx.lo \
elf64-x86-64.lo \
Expand Down Expand Up @@ -604,6 +605,7 @@ BFD64_BACKENDS_CFILES = \
elf64-nfp.c \
elf64-ppc.c \
elf64-s390.c \
elf64-microblaze.c \
elf64-sparc.c \
elf64-tilegx.c \
elf64-x86-64.c \
Expand Down
3 changes: 3 additions & 0 deletions bfd/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,7 @@ BFD64_BACKENDS = \
elf64-riscv.lo \
elfxx-riscv.lo \
elf64-s390.lo \
elf64-microblaze.lo \
elf64-sparc.lo \
elf64-tilegx.lo \
elf64-x86-64.lo \
Expand Down Expand Up @@ -1032,6 +1033,7 @@ BFD64_BACKENDS_CFILES = \
elf64-nfp.c \
elf64-ppc.c \
elf64-s390.c \
elf64-microblaze.c \
elf64-sparc.c \
elf64-tilegx.c \
elf64-x86-64.c \
Expand Down Expand Up @@ -1545,6 +1547,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-ppc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-riscv.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-s390.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-microblaze.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-sparc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-tilegx.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elf64-x86-64.Plo@am__quote@
Expand Down
27 changes: 26 additions & 1 deletion bfd/bfd-in2.h
Original file line number Diff line number Diff line change
Expand Up @@ -5450,16 +5450,41 @@ value relative to the read-write small data area anchor */
expressions of the form "Symbol Op Symbol" */
BFD_RELOC_MICROBLAZE_32_SYM_OP_SYM,

/* This is a 32 bit reloc that stores the 32 bit pc relative
value in two words (with an imm instruction).No relocation is
done here - only used for relaxing */
BFD_RELOC_MICROBLAZE_32_NONE,

/* This is a 64 bit reloc that stores the 32 bit pc relative
value in two words (with an imm instruction). No relocation is
done here - only used for relaxing */
BFD_RELOC_MICROBLAZE_64_NONE,
BFD_RELOC_MICROBLAZE_64_PCREL,

/* This is a 64 bit reloc that stores the 32 bit relative
* +value in two words (with an imml instruction). No relocation is
* +done here - only used for relaxing */
BFD_RELOC_MICROBLAZE_64,

/* This is a 64 bit reloc that stores the 32 bit relative
* +value in two words (with an imml instruction). No relocation is
* +done here - only used for relaxing */
BFD_RELOC_MICROBLAZE_EA64,

/* This is a 64 bit reloc that stores the 32 bit pc relative
* +value in two words (with an imm instruction). No relocation is
* +done here - only used for relaxing */
BFD_RELOC_MICROBLAZE_64_NONE,

/* This is a 64 bit reloc that stores the 32 bit pc relative
value in two words (with an imm instruction). The relocation is
PC-relative GOT offset */
BFD_RELOC_MICROBLAZE_64_GOTPC,

/* This is a 64 bit reloc that stores the 32 bit pc relative
value in two words (with an imml instruction). The relocation is
PC-relative GOT offset */
BFD_RELOC_MICROBLAZE_64_GPC,

/* This is a 64 bit reloc that stores the 32 bit pc relative
value in two words (with an imm instruction). The relocation is
GOT offset */
Expand Down
2 changes: 2 additions & 0 deletions bfd/configure
Original file line number Diff line number Diff line change
Expand Up @@ -13550,6 +13550,8 @@ do
s390_elf64_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;;
score_elf32_be_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo elf64.lo $elf"; want64=true; target_size=64 ;;
score_elf32_le_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo elf64.lo $elf"; want64=true; target_size=64 ;;
microblaze_elf64_vec) tb="$tb elf64-microblaze.lo elf64.lo $elf"; target_size=64 ;;
microblaze_elf64_le_vec) tb="$tb elf64-microblaze.lo elf64.lo $elf"; target_size=64 ;;
sh_coff_vec) tb="$tb coff-sh.lo $coff" ;;
sh_coff_le_vec) tb="$tb coff-sh.lo $coff" ;;
sh_coff_small_vec) tb="$tb coff-sh.lo $coff" ;;
Expand Down
2 changes: 2 additions & 0 deletions bfd/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,8 @@ do
s390_elf64_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;;
score_elf32_be_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo elf64.lo $elf"; want64=true; target_size=64 ;;
score_elf32_le_vec) tb="$tb elf32-score.lo elf32-score7.lo elf32.lo elf64.lo $elf"; want64=true; target_size=64 ;;
microblaze_elf64_vec) tb="$tb elf64-microblaze.lo elf64.lo $elf"; target_size=64 ;;
microblaze_elf64_le_vec) tb="$tb elf64-microblaze.lo elf64.lo $elf"; target_size=64 ;;
sh_coff_vec) tb="$tb coff-sh.lo $coff" ;;
sh_coff_le_vec) tb="$tb coff-sh.lo $coff" ;;
sh_coff_small_vec) tb="$tb coff-sh.lo $coff" ;;
Expand Down
53 changes: 52 additions & 1 deletion bfd/cpu-microblaze.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,24 @@
#include "bfd.h"
#include "libbfd.h"

const bfd_arch_info_type bfd_microblaze_arch =
const bfd_arch_info_type bfd_microblaze_arch[] =
{
#if BFD_DEFAULT_TARGET_SIZE == 64
{
64, /* 32 bits in a word. */
64, /* 32 bits in an address. */
8, /* 8 bits in a byte. */
bfd_arch_microblaze, /* Architecture. */
0, /* Machine number - 0 for now. */
"microblaze", /* Architecture name. */
"MicroBlaze", /* Printable name. */
3, /* Section align power. */
false, /* Is this the default architecture ? */
bfd_default_compatible, /* Architecture comparison function. */
bfd_default_scan, /* String to architecture conversion. */
bfd_arch_default_fill, /* Default fill. */
&bfd_microblaze_arch[1] /* Next in list. */
},
{
32, /* Bits in a word. */
32, /* Bits in an address. */
Expand All @@ -39,4 +56,38 @@ const bfd_arch_info_type bfd_microblaze_arch =
bfd_arch_default_fill, /* Default fill. */
NULL, /* Next in list. */
0 /* Maximum offset of a reloc from the start of an insn. */
}
#else
{
32, /* 32 bits in a word. */
32, /* 32 bits in an address. */
8, /* 8 bits in a byte. */
bfd_arch_microblaze, /* Architecture. */
0, /* Machine number - 0 for now. */
"microblaze", /* Architecture name. */
"MicroBlaze", /* Printable name. */
3, /* Section align power. */
true, /* Is this the default architecture ? */
bfd_default_compatible, /* Architecture comparison function. */
bfd_default_scan, /* String to architecture conversion. */
bfd_arch_default_fill, /* Default fill. */
&bfd_microblaze_arch[1] /* Next in list. */
},
{
64, /* 32 bits in a word. */
64, /* 32 bits in an address. */
8, /* 8 bits in a byte. */
bfd_arch_microblaze, /* Architecture. */
0, /* Machine number - 0 for now. */
"microblaze", /* Architecture name. */
"MicroBlaze", /* Printable name. */
3, /* Section align power. */
false, /* Is this the default architecture ? */
bfd_default_compatible, /* Architecture comparison function. */
bfd_default_scan, /* String to architecture conversion. */
bfd_arch_default_fill, /* Default fill. */
NULL, /* Next in list. */
0 /* Maximum offset of a reloc from the start of an insn. */
}
#endif
};
3 changes: 3 additions & 0 deletions bfd/elf-eh-frame.c
Original file line number Diff line number Diff line change
Expand Up @@ -1044,10 +1044,13 @@ _bfd_elf_parse_eh_frame (bfd *abfd, struct bfd_link_info *info,
goto success;

free_no_table:
/* FIXME: Remove the microblaze specifics when relaxing gets fixed. */
if (bfd_get_arch(abfd) != bfd_arch_microblaze) {
_bfd_error_handler
/* xgettext:c-format */
(_("error in %pB(%pA); no .eh_frame_hdr table will be created"),
abfd, sec);
}
hdr_info->u.dwarf.table = false;
free (sec_info);
success:
Expand Down
Loading