mirror of
https://github.com/darlinghq/darling-gdb.git
synced 2024-11-25 13:09:48 +00:00
13ae64f3c7
for symbols from SHF_TLS section. (_bfd_elf_print_private_bfd_data): Add PT_TLS. (elf_fake_sections): Set SHF_TLS for SEC_THREAD_LOCAL sections. (map_sections_to_segments): Build PT_TLS segment if necessary. (assign_file_positions_for_segments): Likewise. (get_program_header_size): Account for PT_TLS segment. (swap_out_syms): Set type of BSF_THREAD_LOCAL symbols and symbols from SEC_THREAD_LOCAL sections to STT_TLS. * reloc.c: Add 386 and IA-64 TLS relocs. * section.c (SEC_THREAD_LOCAL): Define. (SEC_CONSTRUCTOR_TEXT, SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS): Remove. * elflink.h (elf_link_add_object_symbols): Support .tcommon. (size_dynamic_sections): If DF_STATIC_TLS, set DF_FLAGS unconditionally. (struct elf_final_link_info): Add first_tls_sec. (elf_bfd_final_link): Set first_tls_sec. Compute elf_hash_table (info)->tls_segment. (elf_link_output_extsym): Handle STT_TLS symbols. (elf_link_input_bfd): Likewise. * syms.c (BSF_THREAD_LOCAL): Define. * bfd-in2.h: Rebuilt. * libbfd.h: Rebuilt. * elf32-i386.c (elf_i386_tls_transition, dtpoff_base, tpoff, elf_i386_mkobject, elf_i386_object_p): New functions. (elf_howto_table): Add TLS relocs. (elf_i386_reloc_type_lookup): Support TLS relocs. (elf_i386_info_to_howto_rel): Likewise. (struct elf_i386_link_hash_entry): Add tls_type. (struct elf_i386_obj_tdata): New. (elf_i386_hash_entry, elf_i386_tdata, elf_i386_local_got_tls_type): New macros. (struct elf_i386_link_hash_table): Add tls_ldm_got. (link_hash_newfunc): Clear tls_type. (elf_i386_check_relocs): Support TLS relocs. (elf_i386_gc_sweep_hook): Likewise. (allocate_dynrelocs): Likewise. (elf_i386_size_dynamic_sections): Likewise. (elf_i386_relocate_section): Likewise. (elf_i386_finish_dynamic_symbol): Likewise. (bfd_elf32_mkobject, elf_backend_object_p): Define. * elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add tprel_offset, dtpmod_offset, dtprel_offset, tprel_done, dtpmod_done, dtprel_done, want_tprel, want_dtpmod, want_dtprel. (elfNN_ia64_tprel_base, elfNN_ia64_dtprel_base): New functions. (ia64_howto_table): Add TLS relocs, rename R_IA64_LTOFF_TP22 to R_IA64_LTOFF_TPREL22. (elf_code_to_howto_index): Add TLS relocs. (elfNN_ia64_check_relocs): Support TLS relocs. (allocate_global_data_got): Account for TLS .got data. (allocate_dynrel_entries): Account for TLS dynamic relocations. (elfNN_ia64_install_value): Supprt TLS relocs. (set_got_entry): Support TLS relocs. (elfNN_ia64_relocate_section): Likewise. * config/obj-elf.c (elf_common): Renamed from obj_elf_common. (obj_elf_common): Call elf_common. (obj_elf_tls_common): New function. (elf_pseudo_tab): Support .tls_common. (special_sections): Add .tdata and .tbss. (obj_elf_change_section): Set SEC_THREAD_LOCAL for SHF_TLS sections. (obj_elf_parse_section_letters): Support T in section flags (SHF_TLS). (obj_elf_parse_section_letters): Include T in error message. * config/tc-ppc.c (ppc_section_letter): Likewise. * config/tc-alpha.c (alpha_elf_section_letter): Likewise. (tc_gen_reloc): Handle SEC_THREAD_LOCAL the same way as SEC_MERGE. * config/tc-sparc.c (md_apply_fix3): Likewise. * config/tc-i386.c (tc_i386_fix_adjustable): Add TLS relocs. Define them if not BFD_ASSEMBLER. (lex_got): Support @TLSGD, @TLSLDM, @GOTTPOFF, @TPOFF, @DTPOFF and @NTPOFF. (md_apply_fix3): Add TLS relocs. * config/tc-ia64.c (enum reloc_func): Add FUNC_DTP_MODULE, FUNC_DTP_RELATIVE, FUNC_TP_RELATIVE, FUNC_LT_DTP_MODULE, FUNC_LT_DTP_RELATIVE, FUNC_LT_TP_RELATIVE. (pseudo_func): Support @dtpmod(), @dtprel() and @tprel(). (ia64_elf_section_letter): Include T in error message. (md_begin): Support TLS operators. (md_operand): Likewise. (ia64_gen_real_reloc_type): Support TLS relocs. * testsuite/gas/i386/tlspic.s: New file. * testsuite/gas/i386/tlsd.s: New file. * testsuite/gas/i386/tlsnopic.s: New file. * testsuite/gas/i386/tlsd.d: New file. * testsuite/gas/i386/tlsnopic.d: New file. * testsuite/gas/i386/tlspic.d: New file. * testsuite/gas/i386/i386.exp: Add tlsd, tlsnopic and tlspic tests. * testsuite/gas/ia64/tls.s: New file. * testsuite/gas/ia64/tls.d: New file. * testsuite/gas/ia64/ia64.exp: Add tls test. * write.c (adjust_reloc_syms): Don't change symbols in SEC_THREAD_LOCAL sections to STT_SECTION + addend. * elf/common.h (PT_TLS, SHF_TLS, STT_TLS, DF_STATIC_TLS): Define. * elf/ia64.h (R_IA64_LTOFF_TPREL22): Renamed from R_IA64_LTOFF_TP22. * elf/i386.h: Add TLS relocs. * scripttempl/elf.sc: Add .rel{,a}.t{bss,data}, .tdata and .tbss. * ldlang.c (lang_add_section): Set SEC_THREAD_LOCAL for output section if necessary. Handle .tbss. (lang_size_sections): Clear _raw_size for .tbss section (it allocates space in PT_TLS segment only). * ldwrite.c (build_link_order): Build link order for .tbss too. * readelf.c (get_segment_type): Add PT_TLS. (get_elf_section_flags): Add SHF_TLS. (get_dynamic_flags): Optimize. Add DF_STATIC_TLS. (process_dynamic_segment): Use puts instead of printf. (get_symbol_type): Support STT_TLS. * objdump.c (dump_section_header): Remove SEC_CONSTRUCTOR_TEXT, SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS. Add SEC_THREAD_LOCAL. |
||
---|---|---|
.. | ||
doc | ||
po | ||
testsuite | ||
acinclude.m4 | ||
aclocal.m4 | ||
addr2line.c | ||
ar.c | ||
arlex.l | ||
arparse.y | ||
arsup.c | ||
arsup.h | ||
binemul.c | ||
binemul.h | ||
bucomm.c | ||
bucomm.h | ||
budbg.h | ||
ChangeLog | ||
ChangeLog-9197 | ||
ChangeLog-9899 | ||
coffdump.c | ||
coffgrok.c | ||
coffgrok.h | ||
config.in | ||
configure | ||
configure.com | ||
configure.in | ||
configure.tgt | ||
debug.c | ||
debug.h | ||
deflex.l | ||
defparse.y | ||
dep-in.sed | ||
dlltool.c | ||
dlltool.h | ||
dllwrap.c | ||
emul_aix.c | ||
emul_vanilla.c | ||
filemode.c | ||
ieee.c | ||
is-ranlib.c | ||
is-strip.c | ||
mac-binutils.r | ||
MAINTAINERS | ||
Makefile.am | ||
Makefile.in | ||
makefile.vms-in | ||
maybe-ranlib.c | ||
maybe-strip.c | ||
mpw-config.in | ||
mpw-make.sed | ||
NEWS | ||
nlmconv.c | ||
nlmconv.h | ||
nlmheader.y | ||
nm.c | ||
not-ranlib.c | ||
not-strip.c | ||
objcopy.c | ||
objdump.c | ||
prdbg.c | ||
ranlib.sh | ||
rclex.l | ||
rcparse.y | ||
rdcoff.c | ||
rddbg.c | ||
readelf.c | ||
README | ||
rename.c | ||
resbin.c | ||
rescoff.c | ||
resrc.c | ||
resres.c | ||
sanity.sh | ||
size.c | ||
srconv.c | ||
stabs.c | ||
stamp-h.in | ||
strings.c | ||
sysdump.c | ||
sysinfo.y | ||
syslex.l | ||
sysroff.info | ||
unwind-ia64.c | ||
unwind-ia64.h | ||
version.c | ||
windres.c | ||
windres.h | ||
winduni.c | ||
winduni.h | ||
wrstabs.c |
README for BINUTILS These are the GNU binutils. These are utilities of use when dealing with binary files, either object files or executables. These tools consist of the linker (ld), the assembler (gas), and the profiler (gprof) each of which have their own sub-directory named after them. There is also a collection of other binary tools, including the disassembler (objdump) in this directory. These tools make use of a pair of libraries (bfd and opcodes) and a common set of header files (include). There are README and NEWS files in most of the program sub-directories which give more information about those specific programs. Unpacking and Installation -- quick overview ============================================ When you unpack the binutils archive file, you will get a directory called something like `binutils-XXX', where XXX is the number of the release. (Probably 2.12 or higher). This directory contains various files and sub-directories. Most of the files in the top directory are for information and for configuration. The actual source code is in sub-directories. To build binutils, you can just do: cd binutils-XXX ./configure [options] make make install # copies the programs files into /usr/local/bin # by default. This will configure and build all the libraries as well as the assembler, the binutils, and the linker. If you have GNU make, we recommend building in a different directory: mkdir objdir cd objdir ../binutils-XXX/configure [options] make make install This relies on the VPATH feature of GNU make. By default, the binutils will be configured to support the system on which they are built. When doing cross development, use the --target configure option to specify a different target, eg: ./configure --target=foo-elf The --enable-targets option adds support for more binary file formats besides the default. List them as the argument to --enable-targets, separated by commas. For example: ./configure --enable-targets=sun3,rs6000-aix,decstation The name 'all' compiles in support for all valid BFD targets: ./configure --enable-targets=all On 32-bit hosts though, this support will be restricted to 32-bit target unless the --enable-64-bit-bfd option is also used: ./configure --enable-64-bit-bfd --enable-targets=all You can also specify the --enable-shared option when you run configure. This will build the BFD and opcodes libraries as shared libraries. You can use arguments with the --enable-shared option to indicate that only certain libraries should be built shared; for example, --enable-shared=bfd. The only potential shared libraries in a binutils release are bfd and opcodes. The binutils will be linked against the shared libraries. The build step will attempt to place the correct library in the run-time search path for the binaries. However, in some cases, after you install the binaries, you may have to set an environment variable, normally LD_LIBRARY_PATH, so that the system can find the installed libbfd shared library. To build under openVMS/AXP, see the file makefile.vms in the top level directory. If you don't have ar ==================== If your system does not already have an 'ar' program, the normal binutils build process will not work. In this case, run configure as usual. Before running make, run this script: #!/bin/sh MAKE_PROG="${MAKE-make}" MAKE="${MAKE_PROG} AR=true LINK=true" export MAKE ${MAKE} $* all-libiberty ${MAKE} $* all-intl ${MAKE} $* all-bfd cd binutils MAKE="${MAKE_PROG}" export MAKE ${MAKE} $* ar_DEPENDENCIES= ar_LDADD='../bfd/*.o `cat ../libiberty/required-list ../libiberty/needed-list | sed -e "s,\([^ ][^ ]*\),../libiberty/\1,g"` `if test -f ../intl/gettext.o; then echo '../intl/*.o'; fi`' ar This script will build an ar program in binutils/ar. Move binutils/ar into a directory on your PATH. After doing this, you can run make as usual to build the complete binutils distribution. You do not need the ranlib program in order to build the distribution. Porting ======= Binutils-2.12 supports many different architectures, but there are many more not supported, including some that were supported by earlier versions. We are hoping for volunteers to improve this situation. The major effort in porting binutils to a new host and/or target architecture involves the BFD library. There is some documentation in ../bfd/doc. The file ../gdb/doc/gdbint.texinfo (distributed with gdb-5.x) may also be of help. Reporting bugs ============== Send bug reports and patches to: bug-binutils@gnu.org. Always mention the version number you are running; this is printed by running any of the binutils with the --version option. We appreciate reports about bugs, but we do not promise to fix them. VMS === This section was written by Klaus K"ampf <kkaempf@rmi.de>. It describes how to build and install the binutils on openVMS (Alpha and Vax). (The BFD library only supports reading Vax object files.) Compiling the release: To compile the gnu binary utilities and the gnu assembler, you'll need DEC C or GNU C for openVMS/Alpha. You'll need *both* compilers on openVMS/Vax. Compiling with either DEC C or GNU C works on openVMS/Alpha only. Some of the opcodes and binutils files trap a bug in the DEC C optimizer, so these files must be compiled with /noopt. Compiling on openVMS/Vax is a bit complicated, as the bfd library traps a bug in GNU C and the gnu assembler a bug in (my version of) DEC C. I never tried compiling with VAX C. You further need GNU Make Version 3.76 or later. This is available at ftp.progis.de or any GNU archive site. The makefiles assume that gmake starts gnu make as a foreign command. If you're compiling with DEC C or VAX C, you must run $ @setup before starting gnu-make. This isn't needed with GNU C. On the Alpha you can choose the compiler by editing the toplevel makefile.vms. Either select CC=cc (for DEC C) or CC=gcc (for GNU C) Installing the release Provided that your directory setup conforms to the GNU on openVMS standard, you already have a concealed device named 'GNU_ROOT'. In this case, a simple $ gmake install suffices to copy all programs and libraries to the proper directories. Define the programs as foreign commands by adding these lines to your login.com: $ gas :== $GNU_ROOT:[bin]as.exe $ size :== $GNU_ROOT:[bin]size.exe $ nm :== $GNU_ROOT:[bin]nm.exe $ objdump :== $GNU_ROOT:[bin]objdump.exe $ strings :== $GNU_ROOT:[bin]strings.exe If you have a different directory setup, copy the binary utilities ([.binutils]size.exe, [.binutils]nm.exe, [.binutils]objdump.exe, and [.binutils]strings.exe) and the gnu assembler and preprocessor ([.gas]as.exe and [.gas]gasp.exe]) to a directory of your choice and define all programs as foreign commands. If you're satisfied with the compilation, you may want to remove unneeded objects and libraries: $ gmake clean If you have any problems or questions about the binutils on VMS, feel free to mail me at kkaempf@rmi.de.