diff options
author | Michael Eager <eager@eagercon.com> | 2018-04-17 14:47:13 -0700 |
---|---|---|
committer | Michael Eager <eager@eagercon.com> | 2018-04-17 14:47:13 -0700 |
commit | 3f0a5f17d7fe1f3d0911ad67a5993be59983fb00 (patch) | |
tree | 76261ae8c3c1153a62dc11d955eb7502ef6c8483 /include | |
parent | bedda9aced2b3a8ab05e0fbf1372e394e32afbde (diff) | |
download | gdb-3f0a5f17d7fe1f3d0911ad67a5993be59983fb00.zip gdb-3f0a5f17d7fe1f3d0911ad67a5993be59983fb00.tar.gz gdb-3f0a5f17d7fe1f3d0911ad67a5993be59983fb00.tar.bz2 |
[MicroBlaze] PIC data text relative
Andrew Sadek <andrew.sadek.se@gmail.com>
A new implemented feature in GCC Microblaze that allows Position
Independent Code to run using Data Text Relative addressing instead
of using Global Offset Table.
Its aim was to make 'PIC' more efficient and flexible as elf size
excess performance overhead were noticed when using GOT due to the
indirect addressing.
include/ChangeLog:
* bfdlink.h (Add flag): Add new flag @ 'bfd_link_info' struct.
* 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/ChangeLog:
* bfd/reloc.c (2 new BFD relocations):
BFD_RELOC_MICROBLAZE_64_TEXTPCREL &
BFD_RELOC_MICROBLAZE_64_TEXTPCREL
* bfd/bfd-in2.h: Regenerate
* bfd/libbfd.h: Regenerate
* 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_elf_relocate_section): Handle new relocs in case of
elf relocation.
(microblaze_elf_relax_section): Handle new relocs for elf relaxation.
gas/ChangeLog:
* 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
ld/ChangeLog:
* ld/lexsup.c (Add 2 ld options):
(ld_options): add disable-multiple-abs-defs @ 'ld_options' array
(parse_args): parse new option and pass flag to 'link_info' struct.
* ld/ldlex.h (Add enum): add new enum @ 'option_values' enum.
* ld/ld.texinfo (Add new option): Add description for
'disable-multiple-abs-defs'
* ld/main.c: Initialize flags with false @ 'main'. Handle
disable-multiple-abs-defs @ 'mutiple_definition'.
Diffstat (limited to 'include')
-rw-r--r-- | include/ChangeLog | 9 | ||||
-rw-r--r-- | include/bfdlink.h | 3 | ||||
-rw-r--r-- | include/elf/microblaze.h | 4 |
3 files changed, 15 insertions, 1 deletions
diff --git a/include/ChangeLog b/include/ChangeLog index 2c8d526..52ec004 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,12 @@ +2018-04-09 Andrew Sadek <andrew.sadek.se@gmail.com> + + Microblaze Target: PIC data text relative + + * bfdlink.h (Add flag): Add new flag @ 'bfd_link_info' struct. + * elf/microblaze.h (Add 3 new relocations): + R_MICROBLAZE_TEXTPCREL_64, R_MICROBLAZE_TEXTREL_64 + and R_MICROBLAZE_TEXTREL_32_LO for relax function. + 2018-04-17 Alan Modra <amodra@gmail.com> * elf/i370.h: Revert removal. diff --git a/include/bfdlink.h b/include/bfdlink.h index 5d637ac..773407f 100644 --- a/include/bfdlink.h +++ b/include/bfdlink.h @@ -439,6 +439,9 @@ struct bfd_link_info /* TRUE if ok to have multiple definition. */ unsigned int allow_multiple_definition: 1; + /* TRUE if ok to have prohibit multiple definition of absolute symbols. */ + unsigned int prohibit_multiple_definition_absolute: 1; + /* TRUE if ok to have version with no definition. */ unsigned int allow_undefined_version: 1; diff --git a/include/elf/microblaze.h b/include/elf/microblaze.h index ae98099..dbaa16c 100644 --- a/include/elf/microblaze.h +++ b/include/elf/microblaze.h @@ -58,7 +58,9 @@ START_RELOC_NUMBERS (elf_microblaze_reloc_type) RELOC_NUMBER (R_MICROBLAZE_TLSDTPREL64, 27) /* TLS Offset Within TLS Block */ RELOC_NUMBER (R_MICROBLAZE_TLSGOTTPREL32, 28) /* TLS Offset From Thread Pointer */ RELOC_NUMBER (R_MICROBLAZE_TLSTPREL32, 29) /* TLS Offset From Thread Pointer */ - + RELOC_NUMBER (R_MICROBLAZE_TEXTPCREL_64, 30) /* PC-relative TEXT offset. */ + RELOC_NUMBER (R_MICROBLAZE_TEXTREL_64, 31) /* TEXT Entry offset 64-bit. */ + RELOC_NUMBER (R_MICROBLAZE_TEXTREL_32_LO, 32) /* TEXT Entry offset 32-bit. */ END_RELOC_NUMBERS (R_MICROBLAZE_max) /* Global base address names. */ |