aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-06-24 * objfiles.h (pc_in_section): New prototype.Maciej W. Rozycki24-70/+120
(in_plt_section): Remove name argument, replace prototype with static inline function. * mips-tdep.h: Include "objfiles.h". (in_mips_stubs_section): New function. * hppa-tdep.h (gdbarch_tdep): Remove name argument of in_solib_call_trampoline member. (hppa_in_solib_call_trampoline): Remove name argument. * objfiles.c (pc_in_section): New function. (in_plt_section): Remove function. * mips-linux-tdep.c: Include "objfiles.h". (mips_linux_in_dynsym_stub): Call in_mips_stubs_section. Remove name argument. Return 1 rather than the low 16-bit halfword of any instruction examined. (mips_linux_in_dynsym_resolve_code): Update mips_linux_in_dynsym_stub call accordingly. * mips-tdep.c (mips_stub_frame_sniffer): Use in_mips_stubs_section rather than an equivalent hand-coded sequence. * hppa-hpux-tdep.c (in_opd_section): Remove function. (hppa32_hpux_in_solib_call_trampoline): Remove name argument. (hppa64_hpux_in_solib_call_trampoline): Likewise. (hppa64_hpux_find_global_pointer): Use pc_in_section rather than in_opd_section. * hppa-tdep.c (hppa_stub_unwind_sniffer): Remove name argument on call to tdep->in_solib_call_trampoline. (hppa_in_solib_call_trampoline): Remove name argument, update according to in_plt_section change. (hppa_skip_trampoline_code): Update according to in_plt_section change. * aarch64-tdep.c (aarch64_stub_unwind_sniffer): Likewise. * arm-symbian-tdep.c (arm_symbian_skip_trampoline_code): Likewise. * arm-tdep.c (arm_stub_unwind_sniffer): Likewise. * hppa-linux-tdep.c (hppa_linux_find_global_pointer): Likewise. * hppabsd-tdep.c (hppabsd_find_global_pointer): Likewise. * nios2-tdep.c (nios2_stub_frame_sniffer): Likewise. * nto-tdep.c (nto_relocate_section_addresses): Likewise. * s390-tdep.c (s390_stub_frame_sniffer): Likewise. * sh-tdep.c (sh_stub_unwind_sniffer): Likewise. * solib-dsbt.c (dsbt_in_dynsym_resolve_code): Likewise. * solib-frv.c (frv_in_dynsym_resolve_code): Likewise. * solib-svr4.c (svr4_in_dynsym_resolve_code): Likewise. * solib-target.c (solib_target_in_dynsym_resolve_code): Likewise. * sparc-tdep.c (sparc_analyze_prologue): Likewise. * tic6x-tdep.c (tic6x_stub_unwind_sniffer): Likewise.
2013-06-24Fix host_name and target_name generation by common/create-version.sh.Joel Brobecker2-2/+8
This new script has one small snafoo, which prevented the $host_alias and $target_alias from being expanded during the generation of the version.c file. As a result, the version info yields: This GDB was configured as "--host=$host_alias --target=$target_alias". ^^^^^^^^^^^ ^^^^^^^^^^^^^ This patch fixes this issue. gdb/ChangeLog: * common/create-version.sh: Fix expansion of $host_alias and $target_alias in generation of HOST_NAME and TARGET_NAME (resp.).
2013-06-24gas/Roland McGrath7-1430/+1469
* config/tc-arm.c (arm_symbol_chars): Include '{' and '}'. (arm_reg_parse_multi): Skip whitespace first. (parse_reg_list): Likewise. (parse_vfp_reg_list): Likewise. (s_arm_unwind_save_mmxwcg): Likewise. gas/testsuite/ * gas/arm/macro-pld.s: Add a 'push {r0}' case. * gas/arm/macro-pld.d: Update expected output. * gas/arm/macro-vld1.s: New file. * gas/arm/macro-vld1.d: New file.
2013-06-24 PR gas/15623Nick Clifton2-0/+7
* config/tc-arm.c (do_t_smc): Mark as ending an IT block.
2013-06-24don't keep a gdb-specific dateTom Tromey12-29/+86
Right now there are two nightly commits to update a file in the tree with the current date. One commit is for BFD, one is for gdb. It seems unnecessary to me to do this twice. We can make do with a single such commit. This patch changes gdb in a minimal way to reuse the BFD date -- it extracts it from bfd/version.h and changes version.in to use the placeholder string "DATE" for those times when a date is wanted. I propose removing the cron job that updates the version on trunk, and then check in this patch. For release branches, we can keep the cron job, but just tell it to rewrite bfd/version.h. I believe this is a simple change in the crontab -- the script will work just fine on this file. This also moves version.in and version.h into common/, to reflect their shared status; and updates gdbserver to use version.h besides. * common/create-version.sh: New file. * Makefile.in (version.c): Use bfd/version.h, common/version.in, create-version.sh. (HFILES_NO_SRCDIR): Use common/version.h. * version.in: Move to ... * common/version.in: ... here. Replace date with "DATE". * version.h: Move to ... * common/version.h: ... here. gdbserver: * Makefile.in (version.c): Use bfd/version.h, common/version.in, create-version.sh. (version.o): Remove. * gdbreplay.c: Include version.h. (version, host_name): Don't declare. * server.h: Include version.h. (version, host_name): Don't declare. doc: * Makefile.in (POD2MAN1, POD2MAN5): Use version.subst. (GDBvn.texi): Use version.subst. (version.subst): New target. (mostlyclean): Remove version.subst.
2013-06-24 PR 15657Nick Clifton2-2/+10
* hash.c (_bfd_stringtab_add): Copy the string if COPY is true.
2013-06-24sim: bfin: note missing parallel handling of SEARCHMike Frysinger2-0/+18
The SEARCH insn is an oddball when it comes to parallel usage. It places a big limit on what other insns it can run in parallel with, but we don't currently track the amount of state needed to verify this (since no other insn really requires this). Add a note for now in case we get around to it.
2013-06-24sim: bfin: handle invalid HLs encoding in dsp shift insnsMike Frysinger2-5/+16
For many of the 32bit dsp shift related insns, we were just ignoring the HLs field. The hardware does not though and will reject the insn if it's set incorrectly. Update the sim to match.
2013-06-24sim: bfin: run-tests.sh: fix typo in usage exitMike Frysinger2-1/+5
2013-06-24sim: bfin: se_all32bitopcodes: skip debug insns under the simMike Frysinger2-1/+18
Since the sim has a few fake debug insns that the hardware does not, we need to check for those before attempting to run them. Otherwise we'll randomly trigger the sim debug asserts/aborts/halts insns. On the hardware, these are proper invalid insns, and the table catches that.
2013-06-24sim: bfin: speed up all insn testcases slightlyMike Frysinger2-2/+8
The main body of the "all insn" test is executed once per tested insn, and we test millions of insns here. Any shrinkage we can do in this loop will speed things up nicely (since it's multiplied per tested insn). To that end, simplify the end-of-table test into one less insn, and omit the SSYNC when we build for the sim. When we build to run on the hardware, this insn matters, but the sim doesn't have write store buffers in the chip that might get in the way (memory writes are atomic).
2013-06-24daily updateAlan Modra1-1/+1
2013-06-24*** empty log message ***gdbadmin1-1/+1
2013-06-23include/opcode/Richard Sandiford4-12/+22
* mips.h: Fix comment typo: "G" is _RS rather than _RD for microMIPS. gas/ * config/tc-mips.c (mips_ip): Fix swapped bit numbers in comments.
2013-06-23bfd/Richard Sandiford10-141/+106
* Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Move MIPS ELF files to... (BFD64_BACKENDS, BFD64_BACKENDS_CFILES): ...here. * Makefile.in: Regenerate. * config.bfd: Enclose all MIPS ELF targets in #ifdef BFD64. Set want64 to true for them at the end. * targets.c (_bfd_target_vector): Protect MIPS ELF targets with #ifdef BFD64. gas/ * config/tc-mips.c: Assert that offsetT and valueT are at least 8 bytes in size. (GPR_SMIN, GPR_SMAX): New macros. (macro, mips_ip): Remove code for 4-byte valueT and offsetT. ld/ * Makefile.am (ALL_EMULATION_SOURCES): Move MIPS ELF emulations to... (ALL_64_EMULATION_SOURCES): ...here. * Makefile.in: Regenerate.
2013-06-23sim: bfin: trim trailing whitespaceMike Frysinger2-1/+5
2013-06-23daily updateAlan Modra1-1/+1
2013-06-23*** empty log message ***gdbadmin1-1/+1
2013-06-222013-06-22 Sandra Loosemore <sandra@codesourcery.com>Sandra Loosemore2-6/+5
bfd/ * elf32-nios2.c (nios2_elf32_finish_dynamic_sections): Don't set sh_entsize for PLT section.
2013-06-22gas/testsuite/Richard Sandiford15-2267/+2165
* gas/mips/mips.exp: Remove "LOSE" comments. (run_dump_test_arch): Remove format selector support. (run_dump_test_arches): Remove associated upvars. (elf, ecoff, aout, no_mips16, no_micromips): Remove variables. Remove all conditions based on them, on the assumption that $elf is true and the others are false. Rename "elf-jal" to "jal". (tmips): Set to "t" for *bsd targets. * gas/mips/elf-jal.d: Rename to... * gas/mips/jal.d: ...this, replacing the old file. * gas/mips/micromips@elf-jal.d: Rename to... * gas/mips/micromips@jal.d: ...this. * gas/mips/at-1.d, gas/mips/ld.d, gas/mips/l_d.d, gas/mips/lui.d, gas/mips/mips1@l_d.d, gas/mips/mips1@ld-forward.d, gas/mips/mips1@ld.d, gas/mips/mips1@s_d.d, gas/mips/s_d.d, gas/mips/sd.d: Remove ECOFF relocation names. Do not allow any offset on the symbol.
2013-06-22gas/testsuite/Richard Sandiford2-7/+4
* gas/mips/lineno.d: Remove ellipsis.
2013-06-22gas/Richard Sandiford2-252/+123
* config/tc-mips.c: Remove OBJ_ELF, OBJ_MAYBE_ELF and IS_ELF conditions. Remove any code deselected by them. (s_mips_frame, s_mips_mask): Handle ECOFF_DEBUGGING case first.
2013-06-22 * configure.ac (mips*-*-bsd*, mips*-*-ultrix*, mips*-*-osf*)Richard Sandiford41-419/+113
(mips*-*-ecoff*, mips*-*-pe*, mips*-*-irix* [v4 and earlier]) (mips*-*-lnews*, mips*-*-riscos*): Add gas and ld to noconfigdirs. * configure: Regenerate. gas/ * NEWS: Note removal of ECOFF support. * doc/as.texinfo (--emulation): Update for the removal of MIPS ECOFF. * Makefile.am (TARG_ENV_HFILES): Remove config/te-lnews.h. (MULTI_CFILES): Remove config/e-mipsecoff.c. * Makefile.in: Regenerate. * configure.in: Remove MIPS ECOFF references. (mips-sony-bsd*, mips-*-bsd*, mips-*-lnews*-ecoff, mips-*-*-ecoff): Delete cases. (mips-*-irix5*-*, mips*-*-linux*-*, mips*-*-freebsd*) (mips*-*-kfreebsd*-gnu, mips-*-*-elf): Fold into... (mips-*-*): ...this single case. (mipsbecoff, mipslecoff, mipsecoff): Remove emulations. Expect MIPS emulations to be e-mipself*. * configure: Regenerate. * configure.tgt (mips-sony-bsd*, mips-*-ultrix*, mips-*-osf*) (mips-*-ecoff*, mips-*-pe*, mips-*-irix*, ips-*-lnews*, mips-*-riscos*) (mips-*-sysv*): Remove coff and ecoff cases. * as.c (mipsbecoff, mipslecoff, mipsecoff): Remove. * ecoff.c: Remove reference to MIPS ECOFF. * config/e-mipsecoff.c, config/te-lnews.h: Delete files. * config/tc-mips.c (ECOFF_LITTLE_FORMAT): Delete. (RDATA_SECTION_NAME, mips_target_form): Remove COFF and ECOFF cases. (mips_hi_fixup): Tweak comment. (append_insn): Require a howto. (mips_after_parse_args): Remove OBJ_MAYBE_ECOFF code. gas/testsuite/ * gas/all/gas.exp: Remove reference to mips-ecoff. * gas/mips/branch-misc-1.d, gas/mips/branch-misc-2.d, gas/mips/branch-misc-2-64.d, gas/mips/branch-misc-2pic.d, gas/mips/branch-misc-2pic-64.d, gas/mips/branch-swap.d: Remove skips for mips-*-ecoff. ld/ * NEWS: Document the removal of MIPS ECOFF targets. * ld.texinfo (--gpsize=@var{value}): Use MIPS ELF rather than MIPS ECOFF as an example of a target that supports small data. * ldmain.c (g_switch_value): Likewise. * configure.tgt (mips*-*-pe, mips*-dec-ultrix*, mips*-dec-osf*) (mips*-sgi-irix* [v4 and earlier], mips*el-*-ecoff*, mips*-*-ecoff*) (mips*-*-bsd*, mips*-*-lnews*): Remove cases. * Makefile.am (ALL_EMULATION_SOURCES): Remove emipsbig.c, emipsbsd.c, emipsidt.c, emipsidtl.c, emipslit.c, emipslnews.c and emipspe.c. (emipsbig.c, emipsbsd.c, emipsidt.c, emipsidtl.c, emipslit.c) (emipslnews.c, emipspe.c): Delete rules. * Makefile.in: Regenerate. * emulparams/mipsbig.sh, emulparams/mipsbsd.sh, emulparams/mipsidt.sh, emulparams/mipsidtl.sh, emulparams/mipslit.sh, emulparams/mipslnews.sh, emulparams/mipspe.sh, emultempl/mipsecoff.em: Delete. * emultempl/m68kcoff.em: Update comment to say that MIPS ECOFF support has now been removed. * emultempl/pe.em: Remove TARGET_IS_mipspe checks.
2013-06-22gas/Richard Sandiford3-42/+53
* doc/as.texinfo: Use MIPS rather than @sc{mips} throughout. Use "CPU" instead of "cpu". * doc/c-mips.texi: Likewise. (MIPS Opts): Rename to MIPS Options. (MIPS option stack): Rename to MIPS Option Stack. (MIPS ASE instruction generation overrides): Rename to MIPS ASE Instruction Generation Overrides (for now). (MIPS floating-point): Rename to MIPS Floating-Point.
2013-06-22gas/Richard Sandiford2-34/+123
* doc/c-mips.texi (MIPS Macros): New section. (MIPS Object): Replace with... (MIPS Small Data): ...this new section.
2013-06-22gas/Richard Sandiford2-38/+43
* doc/c-mips.texi (MIPS symbol sizes): Move section further up file. Capitalize name. Use @kindex instead of @cindex for .set entries.
2013-06-22gas/Richard Sandiford2-15/+4
* doc/c-mips.texi (MIPS Stabs): Remove section.
2013-06-22*** empty log message ***gdbadmin1-1/+1
2013-06-22daily updateAlan Modra1-1/+1
2013-06-21Update dates in relevant gdb/gnulib/ copyright headersJoel Brobecker4-3/+9
This patch is the result of re-running the copyright.py script in GDB, after we modified it to stop ignoring some files in gdb/gnulib that should have been updated earlier this year. gdb/ChangeLog: * gdb/gnulib/Makefile.in: Update date in copyright header. * gdb/gnulib/configure.ac: Ditto. * gdb/gnulib/update-gnulib.sh: Ditto.
2013-06-21copyright.py: Handle files in gdb/gnulib owned by GDB.Joel Brobecker2-1/+6
The script was excluding all of gdb/gnulib but this is no longer correct, ever since we moved the imported files to gdb/gnulib/import. As a result, a number of files (Makefile, etc, including this script itself) did not have their copyright header updated. This fixes the problem. gdb/ChangeLog: * copyright.py (EXCLUDE_LIST): Replace "gdb/gnulib" by "gdb/gnulib/import".
2013-06-21 * gdb.trace/actions.exp (check_tracepoint): Don't use a full fileTom Tromey2-1/+7
name in a test name.
2013-06-21gdb/doublest.c: Use frexpl rather than ldfrexp.Will Newton2-48/+7
Most modern systems have frexpl and gnulib provides an implementation for those that don't, so use it instead of the generic but inaccurate ldfrexp. gdb/ChangeLog: 2013-06-21 Will Newton <will.newton@linaro.org> * doublest.c (ldfrexp): Remove function. (convert_doublest_to_floatformat): Call frexpl instead of ldfrexp.
2013-06-21gdb/gnulib: Import frexpl.Will Newton32-140/+8701
gdb/ChangeLog: 2013-06-21 Will Newton <will.newton@linaro.org> * gnulib/update-gnulib.sh(IMPORTED_GNULIB_MODULES): Add frexpl. * gnulib/aclocal.m4: Regenerate. * gnulib/config.in: Regenerate. * gnulib/configure: Regenerate. * gnulib/import/Makefile.am: Update. * gnulib/import/Makefile.in: Update. * gnulib/import/m4/gnulib-cache.m4: Update. * gnulib/import/m4/gnulib-comp.m4: Update. * gnulib/import/float+.h: Import. * gnulib/import/float.c: Import. * gnulib/import/float.in.h: Import. * gnulib/import/fpucw.h: Import. * gnulib/import/frexp.c: Import. * gnulib/import/frexpl.c: Import. * gnulib/import/isnan.c: Import. * gnulib/import/isnand-nolibm.h: Import. * gnulib/import/isnand.c: Import. * gnulib/import/isnanl-nolibm.h: Import. * gnulib/import/isnanl.c: Import. * gnulib/import/itold.c: Import. * gnulib/import/m4/exponentd.m4: Import. * gnulib/import/m4/exponentl.m4: Import. * gnulib/import/m4/float_h.m4: Import. * gnulib/import/m4/fpieee.m4: Import. * gnulib/import/m4/frexp.m4: Import. * gnulib/import/m4/frexpl.m4: Import. * gnulib/import/m4/isnand.m4: Import. * gnulib/import/m4/isnanl.m4: Import. * gnulib/import/m4/math_h.m4: Import. * gnulib/import/math.c: Import. * gnulib/import/math.in.h: Import.
2013-06-21gdb/Jan Kratochvil2-7/+8
* common/linux-btrace.c (cpu_supports_btrace): Remove variable vendor, replace strcmp with signature_INTEL_ebx, signature_INTEL_ecx and signature_INTEL_edx comparisons.
2013-06-21 * msp430-decode.opc: New.Nick Clifton10-113/+5394
* msp430-decode.c: New/generated. * Makefile.am (TARGET_LIBOPCODES_CFILES): Add msp430-decode.c. (MAINTAINER_CLEANFILES): Likewise. Add rule to build msp430-decode.c frommsp430decode.opc using the opc2c program. * Makefile.in: Regenerate. * configure.in: Add msp430-decode.lo to msp430 architecture files. * configure: Regenerate. * msp430-decode.h: New.
2013-06-21 * msp430: New Directory.Nick Clifton17-0/+8534
* configure.tgt: Add it. * configure: Regenerate. * gennltvals.sh: Add msp430 support. * nltvals.def: Regenerate. * Makefile.in: New. * aclocal.m4: Generate. * config.in: Generate. * configure.ac: New. * configure: Generate. * msp430-sim.c: New. * msp430-sim.h: New. * sim-main.h: New. * trace.c: New. * trace.h: New.
2013-06-21*** empty log message ***gdbadmin1-1/+1
2013-06-21daily updateAlan Modra1-1/+1
2013-06-20 symtab/15652Doug Evans2-10/+46
* dwarf2read.c (try_open_dwop_file): New arg search_cwd. All callers updated. (open_dwp_file): If we can't find the dwp file, search the basename in debug-file-directory.
2013-06-20 * dwarf2read.c (struct dwp_file): Fix comment.Doug Evans2-3/+5
(open_and_init_dwp_file): Set dwp_file->name to bfd's file name.
2013-06-20 * source.c (openp): Document OPF_TRY_CWD_FIRST+OPF_SEARCH_IN_PATHDoug Evans2-3/+9
better.
2013-06-20gas/Richard Sandiford12-224/+753
* config/tc-mips.c (ISA_SUPPORTS_SMARTMIPS, ISA_SUPPORTS_DSP_ASE) (ISA_SUPPORTS_DSP64_ASE, ISA_SUPPORTS_DSPR2_ASE, ISA_SUPPORTS_EVA_ASE) (ISA_SUPPORTS_MT_ASE, ISA_SUPPORTS_MCU_ASE, ISA_SUPPORTS_VIRT_ASE) (ISA_SUPPORTS_VIRT64_ASE): Delete. (mips_ase): New structure. (mips_ases): New table. (FP64_ASES): New macro. (mips_ase_groups): New array. (mips_isa_rev, mips_ase_mask, mips_check_isa_supports_ase) (mips_check_isa_supports_ases, mips_set_ase, mips_lookup_ase): New functions. (is_opcode_valid): Use mips_ases to get the 64-bit ASE flags. (md_parse_option): Use mips_ases and mips_set_ase instead of separate case statements for each ASE option. (mips_after_parse_args): Use FP64_ASES. Use mips_check_isa_supports_ases to check the ASEs against other options. (s_mipsset): Use mips_ases and mips_set_ase instead of separate if statements for each ASE option. Use mips_check_isa_supports_ases, even when a non-ASE option is specified. gas/testsuite/ * gas/mips/ase-errors-1.s, gas/mips/ase-errors-1.l, gas/mips/ase-errors-2.s, gas/mips/ase-errors-2.l, gas/mips/ase-errors-3.s, gas/mips/ase-errors-3.l, gas/mips/ase-errors-4.s, gas/mips/ase-errors-4.l: New tests. * gas/mips/mips.exp: Run them.
2013-06-20bfd/Yufeng Zhang6-29/+20
* bfd-in.h (bfd_elf64_aarch64_set_options): Add 'extern'. * bfd-in2.h: Re-generated. * elf64-aarch64.c (RELOC_SECTION): Removed. (SWAP_RELOC_IN, SWAP_RELOC_OUT): Ditto. (AARCH64_ELF_OS_ABI_VERSION): Ditto. (elf64_aarch64_link_hash_traverse): Ditto. (elf64_aarch64_size_stubs): Change 'Aarch64' to 'AArch64' in the comment. opcodes/ * aarch64-dis.c (EMBEDDED_ENV): Remove the check on it. (SYMTAB_AVAILABLE): Removed. (#include "elf/aarch64.h): Ditto.
2013-06-20gdb/Yao Qi2-29/+33
* breakpoint.c (create_breakpoint): Fix code indentation.
2013-06-20gdb/Yao Qi2-4/+9
* breakpoint.c (create_breakpoints_sal_default): Remove parameter 'lsal'. Update declaration. (bkpt_create_breakpoints_sal): Caller update. (tracepoint_create_breakpoints_sal): Likewise.
2013-06-20Teach -data-list-register-values to not include unavailable registersYao Qi9-16/+123
This patch adds an option --skip-unavailable to MI command -data-list-register-values, so that unavailable registers are not displayed (on the context of traceframes). The old -data-list-register-values command behaves like -data-list-register-values x 0 8 ^done,register-values=[{number="0",value="<unavailable>"},{number="8",value="0x80483de"}] With this patch, an option --skip-unavailable is added, -data-list-register-values --skip-unavailable x 0 8 ^done,register-values=[{number="8",value="0x80483de"}] gdb: 2013-06-20 Pedro Alves <pedro@codesourcery.com> Yao Qi <yao@codesourcery.com> * NEWS: Mention the new option '--skip-unavailable' of command -data-list-register-values. * mi/mi-main.c (mi_cmd_data_list_register_values): Accept the --skip-unavailable option. Adjust to use output_register. (output_register): Add new 'skip_unavailable' parameter. Handle it. gdb/doc: 2013-06-20 Pedro Alves <pedro@codesourcery.com> * gdb.texinfo (GDB/MI Data Manipulation) <-data-list-register-values>: Document the --skip-unavailable option. gdb/testsuite: 2013-06-20 Yao Qi <yao@codesourcery.com> * gdb.trace/mi-trace-unavailable.exp: Set tracepoint on 'foo' and set an action. (test_trace_unavailable): Test command -data-list-register-values in the context of traceframe and with option --skip-unavailable. * gdb.trace/trace-unavailable.c (foo): New. (main): Call it. * gdb.mi/gdb2549.exp: Update matching pattern.
2013-06-20*** empty log message ***gdbadmin1-1/+1
2013-06-20daily updateAlan Modra1-1/+1
2013-06-19gdb: clean up x86 cpuid implementationsMike Frysinger11-70/+231
We've currently got 3 files doing open coded implementations of cpuid. Each has its own set of workarounds and varying levels of how well they're written and are generally hardcoded to specific cpuid functions. If you try to build the latest gdb as a PIE on an i386 system, the build will fail because one of them lacks PIC workarounds (wrt ebx). Specifically, we have: common/linux-btrace.c: two copies of cpuid asm w/specific args, one has no workarounds while the other implicitly does to avoid memcpy go32-nat.c: two copies of cpuid asm w/specific args, one has workarounds to avoid memcpy gdb/testsuite/gdb.arch/i386-cpuid.h: one general cpuid asm w/many workarounds copied from older gcc Fortunately, that last header there is pretty damn good -- it handles lots of edge cases, the code is nice & tight (uses gcc asm operands rather than manual movs), and is already almost a general library type header. It's also the basis of what is now the public cpuid.h that is shipped with gcc-4.3+. So what I've done is pull that test header out and into gdb/common/ (not sure if there's a better place), synced to the version found in gcc-4.8.0, put a wrapper API around it, and then cut over all the existing call points to this new header. Since the func already has support for "is cpuid supported on this proc", it makes it trivial to push the i386/x86_64 ifdefs down into this wrapper API too. Now it can be safely used for all targets and gcc will elide the unused code for us. I've verified the gdb.arch testsuite still passes, and this code compiles for an armv7a host as well as x86_64. The go32-nat code has been left ifdef-ed out until someone can test & verify the new stuff works (and if it doesn't, figure out how to make the new code work). URL: https://bugs.gentoo.org/467806 Signed-off-by: Mike Frysinger <vapier@gentoo.org>