daily update
Fix duplicate output section statement lookup

Tie output section statements to their associated output section via
output section userdata.  This allows us to avoid hash lookups which
are slower and fail when multiple output sections have the same name.

	* ldlang.h (lang_output_section_get): Define.
	* ldlang.c (lang_output_section_get): Likewise.
	(init_os): Set the output_section userdata to the output
	section statement.
	* emultempl/hppaelf.em: Use lang_output_section_get instead of
	lang_output_section_find where applicable.
	* emultempl/aarch64elf.em: Likewise.
	* emultempl/aix.em: Likewise.
	* emultempl/armelf.em: Likewise.
	* emultempl/m68hc1xelf.em: Likewise.
	* emultempl/metagelf.em: Likewise.
	* emultempl/mipself.em: Likewise.
	* emultempl/ppc64elf.em: Likewise.
	* emultempl/spuelf.em: Likewise.
Allow self-assignment for absolute symbols defined in a linker script

Modifies ld machinery tracking linker script assignments to notice all
assignments, not just those symbols mentioned in DEFINED().

ld/
	PR ld/14962
	* ldlang.h (struct lang_definedness_hash_entry): Add by_object and
	by_script.  Make iteration a single bit field.
	(lang_track_definedness, lang_symbol_definition_iteration): Delete.
	(lang_symbol_defined): Declare.
	* ldlang.c (lang_statement_iteration): Expand comment a little.
	(lang_init <lang_definedness_table>): Make it bigger.
	(lang_track_definedness, lang_symbol_definition): Delete.
	(lang_definedness_newfunc): Update.
	(lang_symbol_defined): New function.
	(lang_update_definedness): Create entries here.  Do track whether
	script definition of symbol is valid, even when also defined in
	an object file.
	* ldexp.c (fold_name <DEFINED>): Update.
	(fold_name <NAME>): Allow self-assignment for absolute symbols
	defined in a linker script.
ld/testsuite/
	* ld-scripts/pr14962-2.d,
	* ld-scripts/pr14962-2.t: New test.
	* ld-scripts/expr.exp: Run it.
gdb: xtensa: fix linux ptrace includes

Currently, xtensa code using the Linux ptrace interface only include
sys/ptrace.h.  This file comes from the C library (glibc and uClibc,
at least), and includes a declaration of the ptrace() functions, along
with some cross architecture constants that are mostly copied from the
file located at include/uapi/linux/ptrace.h in recent Linux kernels.

For xtensa specific constants like PTRACE_GETXTREGS and
PTRACE_SETXTREGS the asm/ptrace.h include from the Linux kernel UAPI
is needed.  The code in gdbserver xtensa specific part doesn't call
ptrace() directly, so we can remove the unneeded sys/ptrace.h include.
The gdb xtensa specific code needs both headers, since it calls
ptrace().

gdb/
	* xtensa-linux-nat.c: Include asm/ptrace.h.

gdb/gdbserver/
	* linux-xtensa-low.c: Include asm/ptrace.h instead of
	sys/ptrace.h.
Add a testcase for PR ld/2404

PR ld/2404 was fixed without a testcase.  This patch to add one.

	PR ld/2404
	* ld-elf/pr2404.out: New file.
	* ld-elf/pr2404a.c: Likewise.
	* ld-elf/pr2404b.c: Likewise.

	* ld-elf/shared.exp (build_tests): Build libpr2404a.so and
	libpr2404b.a.
	(run_tests): Run pr2404.
convert flags to bitfields

This changes various flags struct cmd_list_element into bitfields.  In
general I think bitfields are cleaner than flag words, at least in a
case like this where there is no need to pass the flags around
independently of the enclosing struct.

2014-01-20  Tom Tromey  <tromey@redhat.com>

	* cli/cli-decode.c (add_cmd, deprecate_cmd, add_alias_cmd)
	(add_setshow_cmd_full, delete_cmd, lookup_cmd_1)
	(deprecated_cmd_warning, complete_on_cmdlist): Update.
	* cli/cli-decode.h (CMD_DEPRECATED, DEPRECATED_WARN_USER)
	(MALLOCED_REPLACEMENT, DOC_ALLOCATED): Remove.
	(struct cmd_list_element) <flags>: Remove.
	<cmd_deprecated, deprecated_warn_user, malloced_replacement,
	doc_allocated>: New fields.
	<hook_in, allow_unknown, abbrev_flag, type, var_type>: Now
	bitfields.
	* maint.c (maintenance_do_deprecate): Update.
	* top.c (execute_command): Update.
better packing for command struct

This moves all the bitfields in struct cmd_list_element to be closer
together.  This packs the structure somewhat better.  On a 64 bit
machine, this simple rearrangement saves around 50k at startup.

2014-01-20  Tom Tromey  <tromey@redhat.com>

	* cli/cli-decode.h (struct cmd_list_element): Move all bitfields
	together.
[AArch64] Define LP64 LE loader name.
[AArch64] Define LP64 BE linker name.
daily update
Don't check shared/export_dynamic/ref_dynamic for type mismatch

There is nothing linker can do when a type mismatched default definition
are made dynamic by info->shared, info->export_dynamic or h->ref_dynamic.
But we do want to avoid exporting it when building PIE.  Let's remove
those checks.

bfd/

	PR ld/2404
	* elflink.c (_bfd_elf_merge_symbol): Don't check info->shared,
	info->export_dynamic, nor !h->ref_dynamic for type mismatch when
	adding the default version.

ld/testsuite/

	PR ld/2404
	* ld-elf/shared.exp: Add a PIE test for PR ld/2404.
Update comments for the last commit
[PATCH] include 	* ansidecl.h (ANSI_PROTOTYPES, PTRCONST, LONG_DOUBLE, PARAMS) 	(VPARAMS, VA_START, VA_OPEN, VA_CLOSE, VA_FIXEDARG, CONST) 	(VOLATILE, SIGNED, PROTO, EXFUN, DEFUN, DEFUN_VOID, AND, DOTS) 	(NOARGS): Don't define. 	* libiberty.h (expandargv, writeargv): Don't use PARAMS. libiberty 	* _doprint.c (checkit): Use stdarg, not VA_* macros. 	* asprintf.c (asprintf): Use stdarg, not VA_* macros. 	* concat.c (concat_length, concat_copy, concat_copy2, concat) 	(reconcat): Use stdarg, not VA_* macros. 	* snprintf.c (snprintf): Use stdarg, not VA_* macros. 	* vasprintf.c (checkit): Use stdarg, not VA_* macros. 	* vsnprintf.c (checkit): Use stdarg, not VA_* macros.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206881 138bc75d-0d04-0410-961f-82ee72b054a4
gdb: Support install-strip target

gdb/
	* configure.ac: Call AM_PROG_INSTALL_STRIP.
	* configure: Regenerate.
	* aclocal.m4: Regenerate.
	* Makefile.in (install_sh, INSTALL_STRIP_PROGRAM, STRIP):
	New substituted	variables.
	(install-strip): New target.
	(INSTALL_SCRIPT): New substituted variable.
	(FLAGS_TO_PASS): Add it.
	(install-only): Use $(INSTALL_SCRIPT) rather than
	$(INSTALL_PROGRAM) for gcore.
Ensure that %func() expressions are outermost terms

This is to avoid expressions like:  %hi(foo) + 1, which will
not do what you expect.  The complex relocations can handle it,
but the internal fixups can't.
daily update
Check incompatible existing default symbol definition

After resolving a versioned reference, foo@VER1, to a default versioned
definition, foo@@VER1, from a shared object, we also merge it with
the existing regular default symbol definition, foo.  When foo is IFUNC
and foo@@VER1 aren't, we will merge 2 incompatible definitions.  This
patch avoids merging foo@@VER1 definition with foo definition if
one is IFUNC and the other isn't.
Make assignments to dot keep an empty output section.

An assignment to dot in an output section that allocates space of
course keeps the output section.  Here, I'm changing the behaviour for
assignments that don't allocate space.  The idea is not so much to
allow people to force output of an empty section with ". = .", but
to fix cases where an otherwise empty section has padding added by an
alignment expression that changes with relaxation or .eh_frame
editing.  Such a section might have zero size before relaxation and so
be stripped incorrectly.

ld/
	* ld.texinfo (Output Section Discarding): Mention assigning to dot
	as a way of keeping otherwise empty sections.
	* ldexp.c (is_dot, is_value, is_sym_value, is_dot_ne_0,
	is_dot_plus_0, is_align_conditional): New predicates.
	(exp_fold_tree_1): Set SEC_KEEP when assigning to dot inside an
	output section, except for some special cases.
	* scripttempl/elfmicroblaze.sc: Use canonical form to align at
	end of .heap and .stack.
ld/testsuite/
	* ld-shared/elf-offset.ld: Align end of .bss with canonical form
	of ALIGN that allows an empty .bss to be removed.
	* ld-arm/arm-dyn.ld: Likewise.
	* ld-arm/arm-lib.ld: Likewise.
	* ld-elfvsb/elf-offset.ld: Likewise.
	* ld-mips-elf/mips-dyn.ld: Likewise.
	* ld-mips-elf/mips-lib.ld: Likewise.
	* ld-arm/arm-no-rel-plt.ld: Remove duplicate ALIGN.
	* ld-powerpc/vle-multiseg-1.ld: Remove ALIGN at start of section.
	ALIGN address of section instead.
	* ld-powerpc/vle-multiseg-2.ld: Likewise.
	* ld-powerpc/vle-multiseg-3.ld: Likewise.
	* ld-powerpc/vle-multiseg-4.ld: Likewise.
	* ld-powerpc/vle-multiseg-6.ld: Likewise.
	* ld-scripts/empty-aligned.d: Check section headers not program
	headers.  Remove xfail and notarget.
	* ld-scripts/empty-aligned.t: Use canonical ALIGN for end of .text2.
Miscellaneous ld tidies

Localise a struct, prevent an unneeded symbol lookup, and fix a
testcase.

ld/
	* ld.h (struct map_symbol_def): Move to..
	* ldlang.h: ..here.
	* ldlang.c (print_assignment): Don't set expld.assign_name to dot.
ld/testsuite/
	* ld-scripts/pr14962-2.d: Correct target triple.
Expand documentation of common-utils.h::FUNCTION_NAME

While looking at this macro, I noticed that it wasn't always necessarily
defined. That prompted me to search the current sources to make sure
that all uses were adequately protected, which they were. But to help
prevent future uses to be made unprotected, this patch expands the
current macro documentation a bit.

gdb/ChangeLog:

        * common/common-utils.h (FUNCTION_NAME): Expand the macro's
        documentation a bit.