public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* 2.15 branch merge
@ 2004-04-09 19:10 Daniel Jacobowitz
  2004-04-10  2:34 ` Alexandre Oliva
  0 siblings, 1 reply; 13+ messages in thread
From: Daniel Jacobowitz @ 2004-04-09 19:10 UTC (permalink / raw)
  To: binutils

I've merged the following patches to the branch.  I'll have more cleanups
and file regeneration today, but this should be the only bulk merge for
2.15; I'll aim for a prerelease tonight.

Index: ChangeLog
from  Daniel Jacobowitz  <drow@mvista.com>

	Merge from mainline:
	2004-02-28  Andrew Cagney  <cagney@redhat.com>
	* src-release (CVS_NAMES): Define.
	(do-tar, do-tar): Prune $(CVS_NAMES).

	2004-02-23  Andrew Cagney  <cagney@redhat.com>
	* texinfo/texinfo.tex: Update from version 2003-02-03.16 to
	2004-02-19.09.

	2004-02-19  Andrew Cagney  <cagney@redhat.com>
	* config.guess: Update from version 2003-06-12 to 2004-02-16.
	* config.sub: Update from version 2003-06-13 to 2004-02-16.

Index: bfd/ChangeLog
from  Daniel Jacobowitz  <drow@mvista.com>

	Merge from mainline:
	2004-04-06  Daniel Jacobowitz  <drow@mvista.com>
	* elfxx-mips.c (MIPS_ELF_STUB_SECTION_NAME): Always use
	".MIPS.stubs".

	2004-04-05  H.J. Lu  <hongjiu.lu@intel.com>
	* elfxx-ia64.c (elfNN_ia64_size_dynamic_sections): Always
	reserve the memory for dynamic linker

	2004-04-01  Andy Chittenden  <achittenden@bluearc.com>
	* stabs.c (struct stab_link_includes_totals): Add field 'symb'
	that keeps the characters in a B_INCL..B_EINCL range.
	(_bfd_link_section_stabs): When computing the sum of the
	characters in a B_INCL..B_EINCL range also keep a copy of those
	characters.  Use this information to distinguish between
	include sections that have the same sum and the same length
	but which are nevertheless unique.

	2004-03-31  Andy Chittenden <achittenden@bluearc.com>
	* stabs.c (struct stab_link_includes_totals): Rename field 'total'
	to 'sum_chars' and add field 'num_chars'.
	(_bfd_link_section_stabs): When computing the sum of the
	characters in a B_INCL..B_EINCL range also keep a count of the
	number of characters.  Use this information to help distinguish
	between include sections when have the same sum but which
	nevertheless are still unique.

	2004-03-31  Mattias Engdegård  <mattias@virtutech.se>
	* stabs.c (_bfd_link_section_stabs): Do not skip N_EXCL stabs.

	2004-03-19  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
	* elf32-hppa.c (elf32_hppa_check_relocs): Handle R_PARISC_PCREL32.
	(final_link_relocate): Likewise.

	2004-03-19  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
	* elf-hppa.h (elf_hppa_reloc_final_type): Handle selectors for
	R_PARISC_PCREL32 and R_PARISC_PCREL64 relocations.

	2004-03-17  Nathan Sidwell  <nathan@codesourcery.com>
	* elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Correct
	logic for null_input_bfd detection.

	2004-03-12  Nick Clifton  <nickc@redhat.com>
	Dave Murphy  <wintermute2k4@ntlworld.com>

	* elf32-arm.h (elf32_arm_merge_private_bfd_data): Skip most checks
	if the input bfd does not contain any code.

	2004-03-02  Alexandre Oliva  <aoliva@redhat.com>
	* elf32-frv.c (struct frv_pic_relocs_info): Added fixups and
	dynrelocs.
	(_frv_count_got_plt_entries): Initialize them.
	(frv_pic_relocs_info_find): Add insert argument.  Adjust all
	callers.
	(frv_pic_relocs_info_for_global): Likewise.
	(frv_pic_relocs_info_for_local): Likewise.
	(frv_pic_merge_early_relocs_info): New.
	(_frv_resolve_final_relocs_info): Use it in case one entry maps to
	another.
	(_frv_add_dyn_reloc): Add entry argument.  Adjust all callers.
	Check that we don't exceed the allocated count for entry.
	(_frv_add_rofixup): Likewise.
	(_frv_emit_got_relocs_plt_entries): Adjust for coding standards.
	(elf32_frv_finish_dynamic_sections): Improve error message in case
	we emit too few rofixup entries.

	2004-02-27  Alexandre Oliva  <aoliva@redhat.com>
	* elf32-frv.c (elf32_frv_howto_table) <R_FRV_LABEL16>: Set
	complain_on_overflow to signed.

	2004-02-27  Jakub Jelinek  <jakub@redhat.com>
	* elf32-s390.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL
	for pc relative relocs.
	(elf_s390_relocate_section): Likewise.
	* elf64-s390.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL
	for pc relative relocs.
	(elf_s390_relocate_section): Likewise.

	2004-02-26  H.J. Lu  <hongjiu.lu@intel.com>
	* elfxx-ia64.c (elfNN_ia64_check_relocs): Fix call to
	count_dyn_reloc.

	2004-02-25  H.J. Lu  <hongjiu.lu@intel.com>
	* elfxx-ia64.c (elfNN_ia64_dyn_reloc_entry): Add the reltext.
	field to track if a relocation is against readonly section.
	(count_dyn_reloc): Take a new argument for rent->reltext.
	(elfNN_ia64_check_relocs): Adjust call to count_dyn_reloc.
	(get_reloc_section): Don't set ia64_info->reltext here.
	(allocate_dynrel_entries): Set ia64_info->reltext here.

	2004-02-24  Alexandre Oliva  <aoliva@redhat.com>
	* elf32-frv.c (FRV_SYM_LOCAL): Weak undefined doesn't imply local.
	(_frv_emit_got_relocs_plt_entries): Decay relocation to protected
	function's descriptor to symbol+offset, and map local undefweak
	symbol to NULL function descriptor.
	(elf32_frv_relocate_section): Likewise.

	2004-02-23  Jakub Jelinek  <jakub@redhat.com>
	* elflink.h (size_dynamic_sections): If not adding DT_FLAGS and
	DF_BIND_NOW is set in info->flags, create DT_BIND_NOW dynamic entry.

	2004-02-21  Danny Smith  <daanysmith@users.sourceforge.net>
	* peXXigen.c (_bfd_XXi_swap_scnhdr_out): Clear
	IMAGE_SCN_MEM_WRITE on known sections only.

	2004-02-19  Jakub Jelinek  <jakub@redhat.com>
	* elf32-sparc.c (elf32_sparc_finish_dynamic_sections): Clear
	.plt sh_entsize.

Index: binutils/ChangeLog
from  Daniel Jacobowitz  <drow@mvista.com>

	Merge from mainline:
	2004-04-07  Benjamin Monate  <benjamin.monate@cea.fr>
	PR 86
	* arsup.c (ar_save): Use smart_rename.

	2004-04-01  Dean Luick <luick@cray.com>
	* readelf.c (display_debug_pubnames): Align offset and data
	columns.
	(read_and_display_attr_value): Add missing break;
	(debug_displays): Enable the display of the .debug_pubtypes
	section.

	2004-03-21  Richard Henderson  <rth@redhat.com>
	* readelf.c (display_debug_frames): Don't crash for mismatched
	DW_CFA_restore_state.

	2004-03-10  Ben Elliston  <bje@gnu.org>
	* MAINTAINERS: Update my mail address.

	2004-03-08  Danny Smith  <dannysmith@users.sourceforge.net>
	* deflex.l: Handle "PRIVATE" string.
	* defparse.y (%token): Add PRIVATE.
	(%type): Add opt_PRIVATE.
	(expline): Pass opt_PRIVATE to def_exports.
	(opt_PRIVATE): Handle PRIVATE token.
	* dlltool.h (def_exports): Add 7th param for private flag to
	declaration.
	* dlltool.c: Add PRIVATE to comment on EXPORTS syntax.
	(struct export): Add 'private' field.
	(def_exports): Set 'private' field of struct exports.
	(scan_drectve_symbols): Adjust calls to def_exports.
	(scan_filtered_symbols): Likewise.
	(dump_def_info): Print 'private' field.
	(gen_def_file): Likewise.
	(gen_lib_file): Skip generation of lib object if private.
	Delete tmp object files in same order as they were generated.
	Don't delete non-existent private object files.

	2004-02-27  Andreas Schwab  <schwab@suse.de>
	* ar.c (main): Support POSIX-compatible argument parsing.

	2004-02-23  Daniel Lucq  <daniel@lucq.org>
	* readelf.c (process_mips_specific): Print conflictsno as an
	unsigned long.

	2004-02-21  Dmitry Timoshkov  <dmitry@baikal.ru>
	* dlltool.c (gen_exp_file): Always output names for forwarded symbols.

	2004-02-19  Jakub Jelinek  <jakub@redhat.com>
	* objcopy.c (copy_section): Avoid warnings.

Index: binutils/testsuite/ChangeLog
from  Daniel Jacobowitz  <drow@mvista.com>

	Merge from mainline:
	2004-02-27  Andreas Schwab  <schwab@suse.de>
	* binutils-all/ar.exp (argument_parsing): New test.

Index: gas/ChangeLog
from  Daniel Jacobowitz  <drow@mvista.com>

	Merge from mainline:
	2004-04-07  Alan Modra  <amodra@bigpond.net.au>
	PR 96
	* config/tc-ppc.c (ppc_elf_suffix): Add valid32 and valid64 fields
	to struct map_bfd.  Adjust MAP macro, and define MAP32, MAP64.
	Update "mapping".  Restrict some @ modifiers to 32 bit.

	2004-04-01  Asgari Jinia  <asgarij@kpitcummins.com>
	Dhananjay Deshpande <dhananjayd@kpitcummins.com>

	* config/tc-sh.c (dont_adjust_reloc_32): New variable.
	(sh_fix_adjustable): Avoid adjusting BFD_RELOC_32 when
	dont_adjust_reloc_32 is set.
	(md_longopts): Add option -renesas.
	(md_parse_option, md_show_usage): Likewise.
	* doc/c-sh.texi: Likewise.

	2004-04-01  Dave Korn  <dk@artimi.com>
	* config/tc-dlx.c (md_assemble): set fx_no_overflow flag for
	hi16 and lo16 fixS structs.
	(md_assemble): generate bit_fixS for RELOC_DLX_LO16 in
	exactly the same way as for RELOC_DLX_REL16.
	(machine_ip): properly respect LO flag in the_insn and
	output RELOC_DLX_LO16 rather than RELOC_DLX_16.
	(md_apply_fix3): apply RELOC_DLX_LO16.

	2004-03-19  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
	* tc-hppa.c (cons_fix_new_hppa): Check for PC relative base type.
	(pa_comm): Set BSF_OBJECT in symbol flags.

	2004-03-18  Nathan Sidwell  <nathan@codesourcery.com>
	* read.c (read_a_source_file): Use demand_empty_rest_of_line.
	(demand_empty_rest_of_line): Issue an error here.
	(ignore_rest_of_line): Silently skip to end.
	(demand_copy_string): Issue an error, not warning.
	(equals): Likewise.
	* config/obj-elf.c (obj_elf_section_name): Likewise.
	(obj_elf_section): Likewise.
	* config/tc-arc.c (arc_extoper): Remove bogus NULL checks.
	(arc_extinst): Likewise.
	* config/tc-ia64.c (dot_saveb): Use demand_empty_rest_of_line.
	(dot_spill): Likewise.
	(dot_unwabi): Likewise.
	(dot_prologue): Likewise.

	2004-03-18  Nathan Sidwell  <nathan@codesourcery.com>
	* expr.c (operand): Reject ++ and --.
	(operator): Likewise.

	2004-03-12  Bob Wilson  <bob.wilson@acm.org>
	* read.c (s_leb128): Call md_flush_pending_output.

	2004-03-07  Andreas Schwab  <schwab@suse.de>
	* doc/c-hppa.texi (HPPA Directives): Fix typo.

	2004-03-07  Richard Henderson  <rth@redhat.com>
	* dw2gencfi.c (output_cie): Align length to 4 byte boundary.
	(cfi_finish): Likewise for fde.

	2004-03-05  H.J. Lu  <hongjiu.lu@intel.com>
	* config/tc-ia64.c (md_assemble): Properly handle NULL
	align_frag.
	(ia64_handle_align): Don't abort if failed to add a stop bit.

	2004-03-04  H.J. Lu  <hongjiu.lu@intel.com>
	* Makefile.in: Regenerated.
	* aclocal.m4: Likewise.
	* configure: Likewise.
	* doc/Makefile.in: Likewise.

	2004-03-03  H.J. Lu  <hongjiu.lu@intel.com>
	* config/tc-ia64.c (dot_align): New.
	(ia64_do_align): Make it static.
	(md_pseudo_table): Use "dot_align" for "align".
	(ia64_md_do_align): Don't set align_frag here.
	(ia64_handle_align): Add a stop bit to the previous bundle if
	needed.

	* config/tc-ia64.h (ia64_do_align): Removed.

	2004-03-02  H.J. Lu  <hongjiu.lu@intel.com>
	* config/tc-ia64.c (align_frag): New.
	(md_assemble): Set the tc_frag_data field in align_frag for
	IA64_OPCODE_FIRST instructions.
	(ia64_md_do_align): Set align_frag.
	(ia64_handle_align): Add a stop bit if needed.

	* config/tc-ia64.h (TC_FRAG_TYPE): New.
	(TC_FRAG_INIT): New.

	2004-02-27  Nick Clifton  <nickc@redhat.com>
	* config/tc-sh.c (get_operand): Revert previous delta.
	(tc_gen_reloc): Check for an unknown reloc type before processing
	the addend.

	2004-02-27  Hannes Reinecke  <hare@suse.de>
	* config/tc-s390.c (s390_insn): Correct range check for opcode in
	.insn pseudo operation.

	2004-02-27  Anil Paranjpe  <anilp1@kpitcummins.com>
	* config/tc-sh.c (get_operand):  In case of #Imm, check has been
	added for wrong syntax.

	2004-02-26  Andrew Stubbs <andrew.stubbs@superh.com>
	* config/tc-sh.c (build_Mytes): Add REG_N_D and REG_N_B01
	nibble types to assembler.

	2004-02-25  Fred Fish  <fnf@redhat.com>
	* config/tc-iq2000.c: Add missing \n\ in multiline string literal.

	2004-02-20  James E Wilson  <wilson@specifixinc.com>
	* config/tc-ia64.c (slot_index): New arg before_relax.  Use instead of
	finalize_syms.
	(fixup_unw_records): New arg before_relax.  Pass to slot_index.
	(ia64_estimate_size_before_relax): New.
	(ia64_convert_frag): Pass 0 to fixup_unw_records.  Add comment.
	(generate_unwind_image): Pass 1 to fixup_unw_records.
	* config/tc-ia64.h (ia64_estimate_size_before_relax): Declare.
	(md_estimate_size_before_relax): Call ia64_estimate_size_before_relax.

	2004-02-19  Jakub Jelinek  <jakub@redhat.com>
	* stabs.c (generate_asm_file): Avoid warning about use of
	uninitialized variable.

	2004-02-18  David Mosberger  <davidm@hpl.hp.com>
	* config/tc-ia64.c (ia64_flush_insns): In addition to prologue,
	body, and endp, allow unwind records which do not have a "t"
	(time/instruction) field.

Index: gas/testsuite/ChangeLog
from  Daniel Jacobowitz  <drow@mvista.com>

	Merge from mainline:
	2004-04-01  Asgari Jinia  <asgarij@kpitcummins.com>
	* gas/sh/renesas-1.s, gas/sh/renesas-1.d: New test for -renesas
	option.
	* gas/sh/basic.exp: Run the new test.

	2004-04-01  Dave Korn  <dk@artimi.com>
	* gas/dlx/alltests.exp: Execute new lohi test.
	* gas/dlx/lohi.s: New test for spurious lo16/hi16
	reloc overflow checking.
	* gas/dlx/lohi.d: New file: expected output.
	* gas/dlx/lhi.d: Updated to properly expect lo16
	relocations where asked for.
	* gas/dlx/itype.d: Likewise.
	* gas/dlx/lhi.d: Corrected cut+paste error in test name.

	2004-03-23  Andreas Schwab  <schwab@suse.de>
	* gas/cfi/cfi-m68k.d: Adjust offsets.

	2004-03-08  Andreas Jaeger  <aj@suse.de>
	* gas/cfi/cfi-s390x-1.d: Adjust offsets.

	2004-03-07  Richard Henderson  <rth@redhat.com>
	* gas/cfi/cfi-common-2.d, gas/cfi/cfi-i386.d: Adjust offsets.

	2004-03-07  Andreas Jaeger  <aj@suse.de>
	* gas/cfi/cfi-x86_64.d: Adjust offsets.

	2004-03-07  Richard Henderson  <rth@redhat.com>
	* gas/alpha/elf-reloc-8.d, gas/cfi/cfi-alpha-1.d,
	gas/cfi/cfi-alpha-2.d, gas/cfi/cfi-alpha-3.d, gas/cfi/cfi-common-1.d,
	gas/cfi/cfi-common-2.d, gas/cfi/cfi-common-3.d: Adjust offsets.

	2004-03-03  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
	* gas/sh/sh64/err-dsp.s: Fix expected error message.

Index: gprof/ChangeLog
from  Daniel Jacobowitz  <drow@mvista.com>

	Merge from mainline:
	2004-03-19  Alan Modra  <amodra@bigpond.net.au>
	* po/sv.po: Updated.

Index: ld/ChangeLog
from  Daniel Jacobowitz  <drow@mvista.com>

	Merge from mainline:
	2004-03-30  Nick Clifton  <nickc@redhat.com>
	* po/sv.po: Updated Swedish translation.

	2004-03-20  Alexandre Oliva  <aoliva@redhat.com>
	* emulparams/elf32frvfd.sh (MAXPAGESIZE): Change to 16Kb.

	2004-03-08  Danny Smith  <dannysmith@users.sourceforge.net>
	* pe-dll.c (pe_dll_generate_implib): Skip sections marked as
	private when building implib.

	2004-03-01  Andreas Schwab  <schwab@suse.de>
	* ld.texinfo (Options): Fix example for --wrap.

	2004-02-25  Danny Smith  <dannysmith@users.sourceforge.net>
	* pe-dll.c (fill_edata): Check that exported_symbol_sections is
	not NULL.

	2004-02-23  Ian Lance Taylor  <ian@wasabisystems.com>
	* ldlang.c (lang_check): Use %P, not %E, in error message.

Index: ld/testsuite/ChangeLog
from  Daniel Jacobowitz  <drow@mvista.com>

	Merge from mainline:
	2004-03-27  Alexandre Oliva  <aoliva@redhat.com>
	* ld-frv/fdpic*.d: Adjust to compensate for page size change.

	2004-02-24  Alexandre Oliva  <aoliva@redhat.com>
	* ld-frv/fdpic-pie-2.d: Adjust for decay of FUNCDESC relocs that
	bind locally.
	* ld-frv/fdpic-pie-8.d: Likewise.
	* ld-frv/fdpic-shared-4.d: Likewise.
	* ld-frv/fdpic-pie-6-fail.d: Renamed from...
	* ld-frv/fdpic-pie-6.d: New test.
	* ld-frv/fdpic-shared-6-fail.d: Renamed from...
	* ld-frv/fdpic-shared-6.d: New test.
	* ld-frv/fdpic6.ldv: New.
	* ld-frv/fdpic-static-6.d: Adjust test name.
	* ld-frv/fdpic-pie-8-fail.d: Removed.
	* ld-frv/fdpic.exp: Run new tests.

Index: opcodes/ChangeLog
from  Daniel Jacobowitz  <drow@mvista.com>

	Merge from mainline:
	2004-03-30  Kazuhiro Inaoka  <inaoka.kazuhiro@renesas.com>
	* m32r-asm.c: Regenerate.

	2004-03-08  Nick Clifton  <nickc@redhat.com>
	* po/de.po: Updated German translation.

	2004-02-26  Andrew Stubbs  <andrew.stubbs@superh.com>
	* sh-opc.h: Move fsca and fsrra instructions from sh4a to sh4.
	Also correct mistake in the comment.

	2004-02-26  Andrew Stubbs <andrew.stubbs@superh.com>
	* sh-dis.c (print_insn_sh): Add REG_N_D nibble type to
	ensure that double registers have even numbers.
	Add REG_N_B01 for nn01 (binary 01) nibble to ensure
	that reserved instruction 0xfffd does not decode the same
	as 0xfdfd (ftrv).
	* sh-opc.h: Add REG_N_D nibble type and use it whereever
	REG_N refers to a double register.
	Add REG_N_B01 nibble type and use it instead of REG_NM
	in ftrv.
	Adjust the bit patterns in a few comments.


-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 2.15 branch merge
  2004-04-09 19:10 2.15 branch merge Daniel Jacobowitz
@ 2004-04-10  2:34 ` Alexandre Oliva
  2004-04-10  3:47   ` Daniel Jacobowitz
  2004-04-10  3:51   ` Alexandre Oliva
  0 siblings, 2 replies; 13+ messages in thread
From: Alexandre Oliva @ 2004-04-10  2:34 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: binutils

[-- Attachment #1: Type: text/plain, Size: 449 bytes --]

On Apr  9, 2004, Daniel Jacobowitz <drow@false.org> wrote:

> 	2004-03-20  Alexandre Oliva  <aoliva@redhat.com>
> 	* emulparams/elf32frvfd.sh (MAXPAGESIZE): Change to 16Kb.

FWIW, this one is not fully effective without this (as I noticed
earlier today ;-)

I'm not sure it affects non-FDPIC as well; I hope not, since the
non-fDPIC emulation sets the page size to 0x1000, but I'll have to
check.  I'm building frv-elf now to test.

Ok to install?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: bfd-frv-16KiB-pages.patch --]
[-- Type: text/x-patch, Size: 708 bytes --]

Index: bfd/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* elf32-frv.c (ELF_MAXPAGESIZE): Make it 0x4000.

Index: bfd/elf32-frv.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-frv.c,v
retrieving revision 1.12.4.2
diff -u -p -r1.12.4.2 elf32-frv.c
--- bfd/elf32-frv.c 9 Apr 2004 18:28:00 -0000 1.12.4.2
+++ bfd/elf32-frv.c 10 Apr 2004 02:24:29 -0000
@@ -4475,7 +4475,7 @@ frv_elf_print_private_bfd_data (abfd, pt
 \f
 #define ELF_ARCH		bfd_arch_frv
 #define ELF_MACHINE_CODE	EM_CYGNUS_FRV
-#define ELF_MAXPAGESIZE		0x1000
+#define ELF_MAXPAGESIZE		0x4000
 
 #define TARGET_BIG_SYM          bfd_elf32_frv_vec
 #define TARGET_BIG_NAME		"elf32-frv"

[-- Attachment #3: Type: text/plain, Size: 188 bytes --]


-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 2.15 branch merge
  2004-04-10  2:34 ` Alexandre Oliva
@ 2004-04-10  3:47   ` Daniel Jacobowitz
  2004-04-10  3:51   ` Alexandre Oliva
  1 sibling, 0 replies; 13+ messages in thread
From: Daniel Jacobowitz @ 2004-04-10  3:47 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: binutils

On Fri, Apr 09, 2004 at 11:26:40PM -0300, Alexandre Oliva wrote:
> On Apr  9, 2004, Daniel Jacobowitz <drow@false.org> wrote:
> 
> > 	2004-03-20  Alexandre Oliva  <aoliva@redhat.com>
> > 	* emulparams/elf32frvfd.sh (MAXPAGESIZE): Change to 16Kb.
> 
> FWIW, this one is not fully effective without this (as I noticed
> earlier today ;-)
> 
> I'm not sure it affects non-FDPIC as well; I hope not, since the
> non-fDPIC emulation sets the page size to 0x1000, but I'll have to
> check.  I'm building frv-elf now to test.
> 
> Ok to install?

Fine for the branch when it goes in for HEAD.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 2.15 branch merge
  2004-04-10  2:34 ` Alexandre Oliva
  2004-04-10  3:47   ` Daniel Jacobowitz
@ 2004-04-10  3:51   ` Alexandre Oliva
  2004-04-10  9:55     ` Daniel Jacobowitz
  2004-04-13  3:47     ` Alan Modra
  1 sibling, 2 replies; 13+ messages in thread
From: Alexandre Oliva @ 2004-04-10  3:51 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: binutils

On Apr  9, 2004, Alexandre Oliva <aoliva@redhat.com> wrote:

> I'm not sure it affects non-FDPIC as well; I hope not, since the
> non-fDPIC emulation sets the page size to 0x1000, but I'll have to
> check.

Checked.  It *does* change the alignment of PT_LOAD segments to 0x4000
even for binaries linked with -melf32frv :-(

I suppose I could create a new bfd arch used for object files that
have the EF_FRV_FDPIC bit set, but this would suck in terms of
duplication of code :-(  Any better ideas?  Is increasing the loadable
segment alignment a big deal?

-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 2.15 branch merge
  2004-04-10  3:51   ` Alexandre Oliva
@ 2004-04-10  9:55     ` Daniel Jacobowitz
  2004-04-12  0:36       ` Alexandre Oliva
  2004-04-13  3:47     ` Alan Modra
  1 sibling, 1 reply; 13+ messages in thread
From: Daniel Jacobowitz @ 2004-04-10  9:55 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: binutils

On Sat, Apr 10, 2004 at 12:47:15AM -0300, Alexandre Oliva wrote:
> On Apr  9, 2004, Alexandre Oliva <aoliva@redhat.com> wrote:
> 
> > I'm not sure it affects non-FDPIC as well; I hope not, since the
> > non-fDPIC emulation sets the page size to 0x1000, but I'll have to
> > check.
> 
> Checked.  It *does* change the alignment of PT_LOAD segments to 0x4000
> even for binaries linked with -melf32frv :-(
> 
> I suppose I could create a new bfd arch used for object files that
> have the EF_FRV_FDPIC bit set, but this would suck in terms of
> duplication of code :-(  Any better ideas?  Is increasing the loadable
> segment alignment a big deal?

Depends on your target, of course: if you have 4K pages, and page-level
virtual memory mappings, then it doesn't much matter.  The extra pages
will waste up to 12 KB worth of virtual address space.  If you don't
have an MMU (doesn't the FRV port support uclinux as a kernel?) then
that might be a much bigger deal, since you'll be wasting real RAM.

Perhaps you should look at COMMONPAGESIZE, which will probably fix
this.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 2.15 branch merge
  2004-04-10  9:55     ` Daniel Jacobowitz
@ 2004-04-12  0:36       ` Alexandre Oliva
  2004-04-12  2:23         ` Daniel Jacobowitz
  0 siblings, 1 reply; 13+ messages in thread
From: Alexandre Oliva @ 2004-04-12  0:36 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: binutils

On Apr 10, 2004, Daniel Jacobowitz <drow@false.org> wrote:

> Depends on your target, of course: if you have 4K pages, and page-level
> virtual memory mappings, then it doesn't much matter.  The extra pages
> will waste up to 12 KB worth of virtual address space.  If you don't
> have an MMU (doesn't the FRV port support uclinux as a kernel?) then
> that might be a much bigger deal, since you'll be wasting real RAM.

There is an MMU on at least one of the parts targeted by the FDPIC
ABI, and the minimum page size is 16KiB.

It's frv-elf that I'm worried about.  This patch changes the `Align'
entry of every PT_LOAD PHDR from 0x1000 to 0x4000.  I don't quite
understand the implications of this change though.

> Perhaps you should look at COMMONPAGESIZE, which will probably fix
> this.

Err...  I don't see how it could.  The problem is that, for non-FDPIC,
I'd like to keep ELFPAGESIZE as it was before, but for FDPIC, I really
need it to be bumped up to 16KiB.

-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 2.15 branch merge
  2004-04-12  0:36       ` Alexandre Oliva
@ 2004-04-12  2:23         ` Daniel Jacobowitz
  0 siblings, 0 replies; 13+ messages in thread
From: Daniel Jacobowitz @ 2004-04-12  2:23 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: binutils

On Sun, Apr 11, 2004 at 06:29:50PM -0300, Alexandre Oliva wrote:
> On Apr 10, 2004, Daniel Jacobowitz <drow@false.org> wrote:
> 
> > Depends on your target, of course: if you have 4K pages, and page-level
> > virtual memory mappings, then it doesn't much matter.  The extra pages
> > will waste up to 12 KB worth of virtual address space.  If you don't
> > have an MMU (doesn't the FRV port support uclinux as a kernel?) then
> > that might be a much bigger deal, since you'll be wasting real RAM.
> 
> There is an MMU on at least one of the parts targeted by the FDPIC
> ABI, and the minimum page size is 16KiB.
> 
> It's frv-elf that I'm worried about.  This patch changes the `Align'
> entry of every PT_LOAD PHDR from 0x1000 to 0x4000.  I don't quite
> understand the implications of this change though.
> 
> > Perhaps you should look at COMMONPAGESIZE, which will probably fix
> > this.
> 
> Err...  I don't see how it could.  The problem is that, for non-FDPIC,
> I'd like to keep ELFPAGESIZE as it was before, but for FDPIC, I really
> need it to be bumped up to 16KiB.

You're probably right, I was confused.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 2.15 branch merge
  2004-04-10  3:51   ` Alexandre Oliva
  2004-04-10  9:55     ` Daniel Jacobowitz
@ 2004-04-13  3:47     ` Alan Modra
  2004-04-16 10:09       ` Alexandre Oliva
  1 sibling, 1 reply; 13+ messages in thread
From: Alan Modra @ 2004-04-13  3:47 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: binutils

On Sat, Apr 10, 2004 at 12:47:15AM -0300, Alexandre Oliva wrote:
> I suppose I could create a new bfd arch used for object files that
> have the EF_FRV_FDPIC bit set, but this would suck in terms of
> duplication of code :-(

grep will show you a number of other architectures that include
elf32-target two or more times.  Doing that in elf32-frv.c, and making a
few tweaks here and there should let you do what you want without much
duplication.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 2.15 branch merge
  2004-04-13  3:47     ` Alan Modra
@ 2004-04-16 10:09       ` Alexandre Oliva
  2004-04-18  2:02         ` Alexandre Oliva
                           ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Alexandre Oliva @ 2004-04-16 10:09 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils

[-- Attachment #1: Type: text/plain, Size: 1989 bytes --]

On Apr 12, 2004, Alan Modra <amodra@bigpond.net.au> wrote:

> On Sat, Apr 10, 2004 at 12:47:15AM -0300, Alexandre Oliva wrote:
>> I suppose I could create a new bfd arch used for object files that
>> have the EF_FRV_FDPIC bit set, but this would suck in terms of
>> duplication of code :-(

> grep will show you a number of other architectures that include
> elf32-target two or more times.  Doing that in elf32-frv.c, and making a
> few tweaks here and there should let you do what you want without much
> duplication.

Ah, yes!  Cool, I'd forgotten we could do that.  It's exactly what I
needed.

This big patch implements your suggestion.  While at that, I thought
I'd rename all FDPIC-specific identifiers to make it clear that
they're FDPIC-only, which made the patch huge.  I attach a separate,
smaller patch-lookalike that shows all non-mechanical changes
contained in the patch.  Having a separate BFD vector has enabled
several simplifications.

I also include a bug fix: when linking a shared library, we wouldn't
relocate contents of debugging sections properly.

I also noticed that the non-PCREL exception handling patch is missing
from the 2.15 branch.  This means FDPIC is pretty much broken, at
least for C++, so there's little point in even trying to fix it in the
branch.  I attach a patch for the branch anyway, after the patch for
mainline.  They're equivalent except for the changes to the EH-related
functions that didn't exist in the branch.

I adjusted the testsuite to accept both bfd vector names, such that
they'd pass in both frv-elf and frv-uclinux.  The latter defaults to
-mfdpic in the assembler now; previously, the linker used the
elf32frvfd emulation but object files assembled directly from source
didn't get the FDPIC bit set, which could be confusing.

No regressions in mainline or branch, both frv-elf and frv-uclinux
tested, the former with --enable-targets=all.

Is the first bzip2ed attachment ok for mainline?  Is the second ok for
the branch?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: elf32-frv.c-nofdpic.diff --]
[-- Type: text/x-patch, Size: 16838 bytes --]

--- bfd/elf32-frv.c
+++ bfd/elf32-frv.c
@@ -1,5 +1,5 @@
 /* FRV-specific support for 32-bit ELF.
-   Copyright 2002, 2003 Free Software Foundation, Inc.
+   Copyright 2002, 2003, 2004 Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -583,6 +583,8 @@ static const struct frv_reloc_map frv_re
 };
 #endif
 
+extern const bfd_target bfd_elf32_frv_vec;
+#define IS_FDPIC(bfd) ((bfd)->xvec == &bfd_elf32_frv_vec)
 
 /* An extension of the elf hash table data structure, containing some
    additional FRV-specific data.  */
@@ -1871,19 +1897,19 @@ elf32_frv_relocate_section (output_bfd, 
 
   isec_segment = _frv_osec_to_segment (output_bfd,
 				       input_section->output_section);
-  if (frv_got_section (info))
+  if (IS_FDPIC (output_bfd) && frv_got_section (info))
     got_segment = _frv_osec_to_segment (output_bfd,
 					frv_got_section (info)
 					->output_section);
   else
     got_segment = -1;
-  if (frv_gotfixup_section (info))
+  if (IS_FDPIC (output_bfd) && frv_gotfixup_section (info))
     gprel_segment = _frv_osec_to_segment (output_bfd,
 					  frv_gotfixup_section (info)
 					  ->output_section);
   else
     gprel_segment = -1;
-  if (elf_hash_table (info)->dynamic_sections_created)
+  if (IS_FDPIC (output_bfd) && elf_hash_table (info)->dynamic_sections_created)
     plt_segment = _frv_osec_to_segment (output_bfd,
 					frv_plt_section (info)
 					->output_section);
@@ -1977,6 +2003,9 @@ elf32_frv_relocate_section (output_bfd, 
 	{
 	case R_FRV_LABEL24:
 	case R_FRV_32:
+	  if (! IS_FDPIC (output_bfd))
+	    goto non_fdpic;
+
 	case R_FRV_GOT12:
 	case R_FRV_GOTHI:
 	case R_FRV_GOTLO:
 	    return FALSE;
 
 	  if (!_frv_emit_got_relocs_plt_entries (picrel, output_bfd, info,
-						 osec, sym, rel->r_addend))
+						      osec, sym,
+						      rel->r_addend))
 	    {
-	      info->callbacks->warning
-		(info, _("Dynamic relocation references symbol with nonzero addend"),
-		 name, input_bfd, input_section, rel->r_offset);
+	      (*_bfd_error_handler)
+		(_("%s: relocation at `%s+0x%x' references symbol `%s' with nonzero addend"),
+		 bfd_archive_filename (input_bfd), input_section->name,
+		 rel->r_offset, name);
 	      return FALSE;
 
 	    }
@@ -2018,6 +2049,7 @@ elf32_frv_relocate_section (output_bfd, 
 	  break;
 
 	default:
+	non_fdpic:
 	  picrel = NULL;
 	  if (h && ! FRV_SYM_LOCAL (info, h))
 	    {
@@ -2033,7 +2065,9 @@ elf32_frv_relocate_section (output_bfd, 
 	{
 	case R_FRV_LABEL24:
 	  check_segment[0] = isec_segment;
-	  if (picrel->plt)
+	  if (! IS_FDPIC (output_bfd))
+	    check_segment[1] = isec_segment;
+	  else if (picrel->plt)
 	    {
 	      relocation = frv_plt_section (info)->output_section->vma
 		+ frv_plt_section (info)->output_offset
@@ -2181,14 +2219,18 @@ elf32_frv_relocate_section (output_bfd, 
 					+ input_section->output_offset,
 					r_type, dynindx, addend, picrel);
 		  }
+		else
+		  addend += frv_got_section (info)->output_section->vma;
 	      }
 
 	    /* We want the addend in-place because dynamic
@@ -2200,6 +2242,12 @@ elf32_frv_relocate_section (output_bfd, 
 	  break;
 
 	case R_FRV_32:
+	  if (! IS_FDPIC (output_bfd))
+	    {
+	      check_segment[0] = check_segment[1] = -1;
+	      break;
+	    }
+	  /* Fall through.  */
 	case R_FRV_FUNCDESC_VALUE:
 	  {
 	    int dynindx;
@@ -2239,7 +2291,7 @@ elf32_frv_relocate_section (output_bfd, 
 	      {
 		if (osec)
 		  addend += osec->output_section->vma;
-		if ((elf_elfheader (input_bfd)->e_flags & EF_FRV_FDPIC)
+		if (IS_FDPIC (input_bfd)
 		    && (bfd_get_section_flags (output_bfd,
 					       input_section->output_section)
 			& (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD))
@@ -2294,14 +2346,18 @@ elf32_frv_relocate_section (output_bfd, 
 					+ input_section->output_offset,
 					r_type, dynindx, addend, picrel);
 		  }
+		else if (osec)
+		  addend += osec->output_section->vma;
 		/* We want the addend in-place because dynamic
 		   relocations are REL.  Setting relocation to it
 		   should arrange for it to be installed.  */
@@ -2357,10 +2414,10 @@ elf32_frv_relocate_section (output_bfd, 
 	  break;
 	}
 
-      if (check_segment[0] != check_segment[1]
-	  && (elf_elfheader (output_bfd)->e_flags & EF_FRV_FDPIC))
+      if (check_segment[0] != check_segment[1] && IS_FDPIC (output_bfd))
 	{
-#if 1
+#if 1 /* If you take this out, remove the #error from fdpic-static-6.d
+	 in the ld testsuite.  */
 	  /* This helps catch problems in GCC while we can't do more
 	     than static linking.  The idea is to test whether the
 	     input file basename is crt0.o only once.  */
@@ -2417,7 +2474,7 @@ elf32_frv_relocate_section (output_bfd, 
       switch (r_type)
 	{
 	case R_FRV_LABEL24:
-	  if (! picrel->plt)
+	  if (! IS_FDPIC (output_bfd) || ! picrel->plt)
 	    break;
 	  /* Fall through.  */
 	  
@@ -2614,6 +2671,7 @@ elf32_frv_add_symbol_hook (abfd, info, s
 
   return TRUE;
 }
+
 /* Create a .got section, as well as its additional info field.  This
    is almost entirely copied from
    elflink.c:_bfd_elf_create_got_section().  */
@@ -2627,6 +2685,7 @@ _frv_create_got_section (bfd *abfd, stru
   struct bfd_link_hash_entry *bh;
   const struct elf_backend_data *bed = get_elf_backend_data (abfd);
   int ptralign;
+  int offset;
 
   /* This function may be called more than once.  */
   s = bfd_get_section_by_name (abfd, ".got");
@@ -2686,6 +2745,8 @@ _frv_create_got_section (bfd *abfd, stru
 
   /* This is the machine-specific part.  Create and initialize section
      data for the got.  */
+  if (IS_FDPIC (abfd))
+    {
   frv_got_section (info) = s;
   frv_relocs_info (info) = htab_try_create (1, frv_pic_relocs_info_hash,
 					    frv_pic_relocs_info_eq,
@@ -2709,13 +2770,21 @@ _frv_create_got_section (bfd *abfd, stru
     return FALSE;
 
   frv_gotfixup_section (info) = s;
+      offset = -2048;
+      flags = BSF_GLOBAL;
+    }
+  else
+    {
+      offset = 2048;
+      flags = BSF_GLOBAL | BSF_WEAK;
+    }
 
-  /* Define _gp in .rofixup, for FDPIC.  If it turns out that
-     we're linking with a different linker script, the linker script
-     will override it.  */
+  /* Define _gp in .rofixup, for FDPIC, or .got otherwise.  If it
+     turns out that we're linking with a different linker script, the
+     linker script will override it.  */
   bh = NULL;
   if (!(_bfd_generic_link_add_one_symbol
-	(info, abfd, "_gp", BSF_GLOBAL, s, -2048, (const char *) NULL, FALSE,
+	(info, abfd, "_gp", flags, s, offset, (const char *) NULL, FALSE,
 	 bed->collect, &bh)))
     return FALSE;
   h = (struct elf_link_hash_entry *) bh;
@@ -2723,7 +2792,7 @@ _frv_create_got_section (bfd *abfd, stru
   h->type = STT_OBJECT;
 
   /* Machine-specific: we want the symbol for executables as well.  */
-  if (! _bfd_elf_link_record_dynamic_symbol (info, h))
+  if (IS_FDPIC (abfd) && ! _bfd_elf_link_record_dynamic_symbol (info, h))
     return FALSE;
   
   return TRUE;
@@ -3454,8 +3534,7 @@ elf32_frvfdpic_size_dynamic_sections (bf
 	return FALSE;
     }
 
-  if (elf_elfheader (output_bfd)->e_flags & EF_FRV_FDPIC)
-    frvfdpic_gotfixup_section (info)->_raw_size = (gpinfo.g.fixups + 1) * 4;
+  frvfdpic_gotfixup_section (info)->_raw_size = (gpinfo.g.fixups + 1) * 4;
   if (frvfdpic_gotfixup_section (info)->_raw_size == 0)
     frvfdpic_gotfixup_section (info)->flags |= SEC_EXCLUDE;
   else
@@ -3559,8 +3639,7 @@ static bfd_boolean
 elf32_frv_always_size_sections (bfd *output_bfd,
 				struct bfd_link_info *info)
 {
-  if (!info->relocatable
-      && elf_elfheader (output_bfd)->e_flags & EF_FRV_FDPIC)
+  if (!info->relocatable)
     {
       struct elf_link_hash_entry *h;
       asection *sec;
@@ -3605,8 +3684,6 @@ static bfd_boolean
 elf32_frv_modify_segment_map (bfd *output_bfd,
 			      struct bfd_link_info *info)
 {
-  if (elf_elfheader (output_bfd)->e_flags & EF_FRV_FDPIC)
-    {
       struct elf_segment_map *m;
 
       for (m = elf_tdata (output_bfd)->segment_map; m != NULL; m = m->next)
@@ -3642,7 +3719,6 @@ elf32_frv_modify_segment_map (bfd *outpu
 	      m->count++;
 	    }
 	}
-    }
 
   return TRUE;
 }
@@ -3650,6 +3726,14 @@ elf32_frv_modify_segment_map (bfd *outpu
 /* Fill in code and data in dynamic sections.  */
 
 static bfd_boolean
+elf32_frv_finish_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
+				   struct bfd_link_info *info ATTRIBUTE_UNUSED)
+{
+  /* Nothing to be done for non-FDPIC.  */
+  return TRUE;
+}
+
+static bfd_boolean
 elf32_frv_finish_dynamic_sections (bfd *output_bfd,
 				   struct bfd_link_info *info)
 {
@@ -3666,8 +3750,6 @@ elf32_frv_finish_dynamic_sections (bfd *
 
       if (frv_gotfixup_section (info))
 	{
-	  if (elf_elfheader (output_bfd)->e_flags & EF_FRV_FDPIC)
-	    {
 	      struct elf_link_hash_entry *hgot = elf_hash_table (info)->hgot;
 	      bfd_vma got_value = hgot->root.u.def.value
 		+ hgot->root.u.def.section->output_section->vma
@@ -3675,29 +3757,14 @@ elf32_frv_finish_dynamic_sections (bfd *
 
 	      _frv_add_rofixup (output_bfd, frv_gotfixup_section (info),
 				got_value, 0);
-	    }
 
 	  if (frv_gotfixup_section (info)->_raw_size
 	      != (frv_gotfixup_section (info)->reloc_count * 4))
 	    {
-	      if (frv_gotfixup_section (info)->_raw_size
-		  < frv_gotfixup_section (info)->reloc_count * 4)
-		{
-		  info->callbacks->warning
-		    (info, "LINKER BUG: .rofixup section size mismatch",
-		     ".rofixup", NULL, NULL, 0);
-		  abort ();
-		  return FALSE;
-		}
-	      else if (!elf_hash_table (info)->dynamic_sections_created)
-		{
-		  info->callbacks->warning
-		    (info, "no dynamic sections, missing -melf32frvfd?",
-		     ".rofixup", NULL, NULL, 0);
+	      (*_bfd_error_handler)
+		("LINKER BUG: .rofixup section size mismatch");
 		  return FALSE;
 		}
-	      BFD_ASSERT (0);
-	    }
 	}
     }
   if (elf_hash_table (info)->dynamic_sections_created)
@@ -3807,14 +3877,11 @@ frv_elf_use_relative_eh_frame
 			       asection *eh_frame_section ATTRIBUTE_UNUSED)
 {
   /* We can't use PC-relative encodings in FDPIC binaries, in general.  */
-  if (elf_elfheader (input_bfd)->e_flags & EF_FRV_FDPIC)
-    return FALSE;
-
-  return TRUE;
+  return FALSE;
 }
 
@@ -3829,11 +3896,6 @@ frv_elf_encode_eh_address (bfd *abfd,
 {
   struct elf_link_hash_entry *h;
 
-  /* Non-FDPIC binaries can use PC-relative encodings.  */
-  if (! (elf_elfheader (abfd)->e_flags & EF_FRV_FDPIC))
-    return _bfd_elf_encode_eh_address (abfd, info, osec, offset,
-				       loc_sec, loc_offset, encoded);
-
   h = elf_hash_table (info)->hgot;
   BFD_ASSERT (h && h->root.type == bfd_link_hash_defined);
 
@@ -3996,8 +4058,6 @@ elf32_frv_check_relocs (abfd, info, sec,
 
       switch (ELF32_R_TYPE (rel->r_info))
 	{
-	case R_FRV_LABEL24:
-	case R_FRV_32:
 	case R_FRV_GOT12:
 	case R_FRV_GOTHI:
 	case R_FRV_GOTLO:
@@ -4012,12 +4072,26 @@ elf32_frv_check_relocs (abfd, info, sec,
 	case R_FRV_FUNCDESC_GOTOFFLO:
 	case R_FRV_FUNCDESC:
 	case R_FRV_FUNCDESC_VALUE:
+	  if (! IS_FDPIC (abfd))
+	    goto bad_reloc;
+	  /* Fall through.  */
+	case R_FRV_GPREL12:
+	case R_FRV_GPRELU12:
+	case R_FRV_GPRELHI:
+	case R_FRV_GPRELLO:
+	case R_FRV_LABEL24:
+	case R_FRV_32:
 	  if (! dynobj)
 	    {
 	      elf_hash_table (info)->dynobj = dynobj = abfd;
 	      if (! _frv_create_got_section (abfd, info))
 		return FALSE;
 	    }
+	  if (! IS_FDPIC (abfd))
+	    {
+	      picrel = NULL;
+	      break;
+	    }
 	  if (h != NULL)
 	    {
 	      if (h->dynindx == -1)
@@ -4051,6 +4125,7 @@ elf32_frv_check_relocs (abfd, info, sec,
       switch (ELF32_R_TYPE (rel->r_info))
         {
 	case R_FRV_LABEL24:
+	  if (IS_FDPIC (abfd))
 	  picrel->call = 1;
 	  break;
 		
@@ -4059,7 +4134,11 @@ elf32_frv_check_relocs (abfd, info, sec,
 	  if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
 	    picrel->relocs32--;
 	  /* Fall through.  */
+
 	case R_FRV_32:
+	  if (! IS_FDPIC (abfd))
+	    break;
+
 	  picrel->sym = 1;
 	  if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
 	    picrel->relocs32++;
@@ -4116,6 +4195,23 @@ elf32_frv_check_relocs (abfd, info, sec,
           if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend))
             return FALSE;
           break;
+
+	case R_FRV_LABEL16:
+	case R_FRV_LO16:
+	case R_FRV_HI16:
+	case R_FRV_GPREL12:
+	case R_FRV_GPRELU12:
+	case R_FRV_GPREL32:
+	case R_FRV_GPRELHI:
+	case R_FRV_GPRELLO:
+	  break;
+
+	default:
+	bad_reloc:
+	  (*_bfd_error_handler)
+	    (_("%s: unsupported relocation type %i"),
+	     bfd_archive_filename (abfd), ELF32_R_TYPE (rel->r_info));
+	  return FALSE;
         }
     }
 
@@ -4152,7 +4248,8 @@ elf32_frv_object_p (abfd)
      bfd *abfd;
 {
   bfd_default_set_arch_mach (abfd, bfd_arch_frv, elf32_frv_machine (abfd));
-  return TRUE;
+  return (((elf_elfheader (abfd)->e_flags & EF_FRV_FDPIC) != 0)
+	  == (IS_FDPIC (abfd)));
 }
 \f
 /* Function to set the ELF flag bits.  */
@@ -4460,6 +4557,20 @@ frv_elf_merge_private_bfd_data (ibfd, ob
   if (old_partial != (old_flags & EF_FRV_CPU_MASK))
     bfd_default_set_arch_mach (obfd, bfd_arch_frv, elf32_frv_machine (obfd));
 
+  if (((new_flags & EF_FRV_FDPIC) == 0)
+      != (! IS_FDPIC (ibfd)))
+    {
+      error = TRUE;
+      if (IS_FDPIC (obfd))
+	(*_bfd_error_handler)
+	  (_("%s: cannot link non-fdpic object file into fdpic executable"),
+	   bfd_get_filename (ibfd));
+      else
+	(*_bfd_error_handler)
+	  (_("%s: cannot link fdpic object file into non-fdpic executable"),
+	   bfd_get_filename (ibfd));
+    }
+
   if (error)
     bfd_set_error (bfd_error_bad_value);
 
@@ -4557,7 +4668,6 @@ frv_elf_print_private_bfd_data (abfd, pt
 #define TARGET_BIG_SYM          bfd_elf32_frv_vec
 #define TARGET_BIG_NAME		"elf32-frv"
 
-#define elf_info_to_howto_rel			frv_info_to_howto_rel
 #define elf_info_to_howto			frv_info_to_howto_rela
 #define elf_backend_relocate_section		elf32_frv_relocate_section
 #define elf_backend_gc_mark_hook		elf32_frv_gc_mark_hook
@@ -4575,39 +4685,73 @@ frv_elf_print_private_bfd_data (abfd, pt
 #define bfd_elf32_bfd_merge_private_bfd_data	frv_elf_merge_private_bfd_data
 #define bfd_elf32_bfd_print_private_bfd_data	frv_elf_print_private_bfd_data
 
-#define bfd_elf32_bfd_link_hash_table_create  frv_elf_link_hash_table_create
+#define elf_backend_want_got_sym	1
+#define elf_backend_got_header_size	0
+#define elf_backend_want_got_plt	0
+#define elf_backend_plt_readonly	1
+#define elf_backend_want_plt_sym	0
+#define elf_backend_plt_header_size	0
+
+#define elf_backend_finish_dynamic_sections \
+		elf32_frv_finish_dynamic_sections
+
+#include "elf32-target.h"
+
+#undef ELF_MAXPAGESIZE
+#define ELF_MAXPAGESIZE		0x4000
+
+#undef TARGET_BIG_SYM
+#define TARGET_BIG_SYM          bfd_elf32_frv_vec
+#undef TARGET_BIG_NAME
+#define TARGET_BIG_NAME		"elf32-frv"
+#undef	elf32_bed
+#define	elf32_bed		elf32_frv_bed
+
+#undef elf_info_to_howto_rel
+#define elf_info_to_howto_rel	frv_info_to_howto_rel
+
+#undef bfd_elf32_bfd_link_hash_table_create
+#define bfd_elf32_bfd_link_hash_table_create \
+		frv_elf_link_hash_table_create
+#undef elf_backend_always_size_sections
 #define elf_backend_always_size_sections \
 		elf32_frv_always_size_sections
+#undef elf_backend_modify_segment_map
 #define elf_backend_modify_segment_map \
 		elf32_frv_modify_segment_map
 
+#undef elf_backend_create_dynamic_sections
 #define elf_backend_create_dynamic_sections \
 		elf32_frv_create_dynamic_sections
+#undef elf_backend_adjust_dynamic_symbol
 #define elf_backend_adjust_dynamic_symbol \
 		elf32_frv_adjust_dynamic_symbol
+#undef elf_backend_size_dynamic_sections
 #define elf_backend_size_dynamic_sections \
 		elf32_frv_size_dynamic_sections
+#undef elf_backend_finish_dynamic_symbol
 #define elf_backend_finish_dynamic_symbol \
 		elf32_frv_finish_dynamic_symbol
+#undef elf_backend_finish_dynamic_sections
 #define elf_backend_finish_dynamic_sections \
 		elf32_frv_finish_dynamic_sections
 
-#define elf_backend_want_got_sym	1
-#define elf_backend_got_header_size	0
-#define elf_backend_want_got_plt	0
-#define elf_backend_plt_readonly	1
-#define elf_backend_want_plt_sym	0
-#define elf_backend_plt_header_size	0
-
+#undef elf_backend_can_make_relative_eh_frame
 #define elf_backend_can_make_relative_eh_frame \
 		frv_elf_use_relative_eh_frame
+#undef elf_backend_can_make_lsda_relative_eh_frame
 #define elf_backend_can_make_lsda_relative_eh_frame \
 		frv_elf_use_relative_eh_frame
-#define elf_backend_encode_eh_address	frv_elf_encode_eh_address
+#undef elf_backend_encode_eh_address
+#define elf_backend_encode_eh_address \
+		frv_elf_encode_eh_address
 
+#undef elf_backend_may_use_rel_p
 #define elf_backend_may_use_rel_p       1
+#undef elf_backend_may_use_rela_p
 #define elf_backend_may_use_rela_p      1
 /* We use REL for dynamic relocations only.  */
+#undef elf_backend_default_use_rela_p
 #define elf_backend_default_use_rela_p  1
 
 #include "elf32-target.h"

[-- Attachment #3: frvfdpic-bfdvec.patch.bz2 --]
[-- Type: application/x-bzip2, Size: 17357 bytes --]

[-- Attachment #4: frvfdpic-bfdvec.patch.bz2 --]
[-- Type: application/x-bzip2, Size: 16699 bytes --]

[-- Attachment #5: Type: text/plain, Size: 187 bytes --]

-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 2.15 branch merge
  2004-04-16 10:09       ` Alexandre Oliva
@ 2004-04-18  2:02         ` Alexandre Oliva
  2004-04-20 16:29         ` Daniel Jacobowitz
  2004-05-06  2:12         ` Alexandre Oliva
  2 siblings, 0 replies; 13+ messages in thread
From: Alexandre Oliva @ 2004-04-18  2:02 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils

On Apr 16, 2004, Alexandre Oliva <aoliva@redhat.com> wrote:

> +#include "elf32-target.h"
> +
> +#undef ELF_MAXPAGESIZE
> +#define ELF_MAXPAGESIZE		0x4000
> +
> +#undef TARGET_BIG_SYM
> +#define TARGET_BIG_SYM          bfd_elf32_frv_vec
> +#undef TARGET_BIG_NAME
> +#define TARGET_BIG_NAME		"elf32-frv"
> +#undef	elf32_bed
> +#define	elf32_bed		elf32_frv_bed

Alan Modra pointed out in private that my simplified patch was overly
simplified.  The above names, just like the rest below, underwent a
s/frvfdpic/frv/, to make the diff smaller, but also more confusing at
this point.  I apologize for any confusion this may cause.  The actual
patch has frvfdpic in the above macros.

-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 2.15 branch merge
  2004-04-16 10:09       ` Alexandre Oliva
  2004-04-18  2:02         ` Alexandre Oliva
@ 2004-04-20 16:29         ` Daniel Jacobowitz
  2004-05-06  1:57           ` Alexandre Oliva
  2004-05-06  2:12         ` Alexandre Oliva
  2 siblings, 1 reply; 13+ messages in thread
From: Daniel Jacobowitz @ 2004-04-20 16:29 UTC (permalink / raw)
  To: binutils

On Fri, Apr 16, 2004 at 05:31:13AM -0300, Alexandre Oliva wrote:
> I also noticed that the non-PCREL exception handling patch is missing
> from the 2.15 branch.  This means FDPIC is pretty much broken, at
> least for C++, so there's little point in even trying to fix it in the
> branch.  I attach a patch for the branch anyway, after the patch for
> mainline.  They're equivalent except for the changes to the EH-related
> functions that didn't exist in the branch.

I don't much care what you do to the FRV specific files on the branch -
the FRV port is not in wide use yet and the changes to other files are
very simple.  So go ahead if it's approved for HEAD.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 2.15 branch merge
  2004-04-20 16:29         ` Daniel Jacobowitz
@ 2004-05-06  1:57           ` Alexandre Oliva
  0 siblings, 0 replies; 13+ messages in thread
From: Alexandre Oliva @ 2004-05-06  1:57 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: binutils

[-- Attachment #1: Type: text/plain, Size: 793 bytes --]

On Apr 20, 2004, Daniel Jacobowitz <drow@false.org> wrote:

> On Fri, Apr 16, 2004 at 05:31:13AM -0300, Alexandre Oliva wrote:
>> I also noticed that the non-PCREL exception handling patch is missing
>> from the 2.15 branch.  This means FDPIC is pretty much broken, at
>> least for C++, so there's little point in even trying to fix it in the
>> branch.  I attach a patch for the branch anyway, after the patch for
>> mainline.  They're equivalent except for the changes to the EH-related
>> functions that didn't exist in the branch.

> I don't much care what you do to the FRV specific files on the branch -
> the FRV port is not in wide use yet and the changes to other files are
> very simple.  So go ahead if it's approved for HEAD.

Ok, I'm checking this in, merged this from mainline.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: bfd-frv-no-pcrel-eh-frame.patch --]
[-- Type: text/x-patch, Size: 10384 bytes --]

Index: bfd/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	Merge from mainline:
	2004-02-27  Alexandre Oliva  <aoliva@redhat.com>
	* elf-bfd.h (struct elf_backend_data): Added
	elf_backend_can_make_relative_eh_frame,
	elf_backend_can_make_lsda_relative_eh_frame and
	elf_backend_encode_eh_address.
	(_bfd_elf_encode_eh_address): Declare.
	(_bfd_elf_can_make_relative): Declare.
	* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Use new
	hooks to decide whether to attempt to make_relative and
	make_lsda_relative.
	(_bfd_elf_write_section_eh_frame_hdr): Call encode_eh_address.
	(_bfd_elf_can_make_relative): New.
	(_bfd_elf_encode_eh_address): New.
	* elf32-frv.c (frv_elf_use_relative_eh_frame): New.
	(frv_elf_encode_eh_address): New.
	(elf_backend_can_make_relative_eh_frame): Define.
	(elf_backend_can_make_lsda_relative_eh_frame): Define.
	(elf_backend_encode_eh_address): Define.
	* elfxx-target.h
	(elf_backend_can_make_relative_eh_frame): Define.
	(elf_backend_can_make_lsda_relative_eh_frame): Define.
	(elf_backend_encode_eh_address): Define.
	(elfNN_bed): Add them.

Index: bfd/elf-bfd.h
===================================================================
RCS file: /cvs/src/src/bfd/elf-bfd.h,v
retrieving revision 1.125.4.1
diff -u -p -r1.125.4.1 elf-bfd.h
--- bfd/elf-bfd.h 8 Apr 2004 12:41:35 -0000 1.125.4.1
+++ bfd/elf-bfd.h 6 May 2004 01:53:10 -0000
@@ -861,6 +861,24 @@ struct elf_backend_data
   bfd_boolean (*elf_backend_ignore_discarded_relocs)
     (asection *);
 
+  /* These functions tell elf-eh-frame whether to attempt to turn
+     absolute or lsda encodings into pc-relative ones.  The default
+     definition enables these transformations.  */
+  bfd_boolean (*elf_backend_can_make_relative_eh_frame)
+     (bfd *, struct bfd_link_info *, asection *);
+  bfd_boolean (*elf_backend_can_make_lsda_relative_eh_frame)
+     (bfd *, struct bfd_link_info *, asection *);
+
+  /* This function returns an encoding after computing the encoded
+     value (and storing it in ENCODED) for the given OFFSET into OSEC,
+     to be stored in at LOC_OFFSET into the LOC_SEC input section.
+     The default definition chooses a 32-bit PC-relative encoding.  */
+  bfd_byte (*elf_backend_encode_eh_address)
+     (bfd *abfd, struct bfd_link_info *info,
+      asection *osec, bfd_vma offset,
+      asection *loc_sec, bfd_vma loc_offset,
+      bfd_vma *encoded);
+
   /* This function, if defined, may write out the given section.
      Returns TRUE if it did so and FALSE if the caller should.  */
   bfd_boolean (*elf_backend_write_section)
@@ -1295,6 +1313,12 @@ extern void _bfd_elf_sprintf_vma
   (bfd *, char *, bfd_vma);
 extern void _bfd_elf_fprintf_vma
   (bfd *, void *, bfd_vma);
+
+extern bfd_byte _bfd_elf_encode_eh_address
+  (bfd *abfd, struct bfd_link_info *info, asection *osec, bfd_vma offset,
+   asection *loc_sec, bfd_vma loc_offset, bfd_vma *encoded);
+extern bfd_boolean _bfd_elf_can_make_relative
+  (bfd *input_bfd, struct bfd_link_info *info, asection *eh_frame_section);
 
 extern enum elf_reloc_type_class _bfd_elf_reloc_type_class
   (const Elf_Internal_Rela *);
Index: bfd/elf-eh-frame.c
===================================================================
RCS file: /cvs/src/src/bfd/elf-eh-frame.c,v
retrieving revision 1.27
diff -u -p -r1.27 elf-eh-frame.c
--- bfd/elf-eh-frame.c 16 Oct 2003 21:04:04 -0000 1.27
+++ bfd/elf-eh-frame.c 6 May 2004 01:53:11 -0000
@@ -518,10 +518,16 @@ _bfd_elf_discard_section_eh_frame
 	  /* For shared libraries, try to get rid of as many RELATIVE relocs
 	     as possible.  */
           if (info->shared
+	      && (get_elf_backend_data (abfd)
+		  ->elf_backend_can_make_relative_eh_frame
+		  (abfd, info, sec))
 	      && (cie.fde_encoding & 0xf0) == DW_EH_PE_absptr)
 	    cie.make_relative = 1;
 
 	  if (info->shared
+	      && (get_elf_backend_data (abfd)
+		  ->elf_backend_can_make_lsda_relative_eh_frame
+		  (abfd, info, sec))
 	      && (cie.lsda_encoding & 0xf0) == DW_EH_PE_absptr)
 	    cie.make_lsda_relative = 1;
 
@@ -1120,6 +1126,7 @@ _bfd_elf_write_section_eh_frame_hdr (bfd
   asection *eh_frame_sec;
   bfd_size_type size;
   bfd_boolean retval;
+  bfd_vma encoded_eh_frame;
 
   htab = elf_hash_table (info);
   hdr_info = &htab->eh_info;
@@ -1143,7 +1150,10 @@ _bfd_elf_write_section_eh_frame_hdr (bfd
 
   memset (contents, 0, EH_FRAME_HDR_SIZE);
   contents[0] = 1;				/* Version.  */
-  contents[1] = DW_EH_PE_pcrel | DW_EH_PE_sdata4; /* .eh_frame offset.  */
+  contents[1] = get_elf_backend_data (abfd)->elf_backend_encode_eh_address
+    (abfd, info, eh_frame_sec, 0, sec, 4,
+     &encoded_eh_frame);			/* .eh_frame offset.  */
+
   if (hdr_info->array && hdr_info->array_count == hdr_info->fde_count)
     {
       contents[2] = DW_EH_PE_udata4;		/* FDE count encoding.  */
@@ -1154,8 +1164,8 @@ _bfd_elf_write_section_eh_frame_hdr (bfd
       contents[2] = DW_EH_PE_omit;
       contents[3] = DW_EH_PE_omit;
     }
-  bfd_put_32 (abfd, eh_frame_sec->vma - sec->output_section->vma - 4,
-	      contents + 4);
+  bfd_put_32 (abfd, encoded_eh_frame, contents + 4);
+
   if (contents[2] != DW_EH_PE_omit)
     {
       unsigned int i;
@@ -1180,4 +1190,30 @@ _bfd_elf_write_section_eh_frame_hdr (bfd
 				     sec->_cooked_size);
   free (contents);
   return retval;
+}
+
+/* Decide whether we can use a PC-relative encoding within the given
+   EH frame section.  This is the default implementation.  */
+
+bfd_boolean
+_bfd_elf_can_make_relative (bfd *input_bfd ATTRIBUTE_UNUSED,
+			    struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			    asection *eh_frame_section ATTRIBUTE_UNUSED)
+{
+  return TRUE;
+}
+
+/* Select an encoding for the given address.  Preference is given to
+   PC-relative addressing modes.  */
+
+bfd_byte
+_bfd_elf_encode_eh_address (bfd *abfd ATTRIBUTE_UNUSED,
+			    struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			    asection *osec, bfd_vma offset,
+			    asection *loc_sec, bfd_vma loc_offset,
+			    bfd_vma *encoded)
+{
+  *encoded = osec->vma + offset -
+    (loc_sec->output_section->vma + loc_sec->output_offset + loc_offset);
+  return DW_EH_PE_pcrel | DW_EH_PE_sdata4;
 }
Index: bfd/elf32-frv.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-frv.c,v
retrieving revision 1.12.4.2
diff -u -p -r1.12.4.2 elf32-frv.c
--- bfd/elf32-frv.c 9 Apr 2004 18:28:00 -0000 1.12.4.2
+++ bfd/elf32-frv.c 6 May 2004 01:53:14 -0000
@@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suit
 #include "libbfd.h"
 #include "elf-bfd.h"
 #include "elf/frv.h"
+#include "elf/dwarf2.h"
 #include "hashtab.h"
 
 /* Forward declarations.  */
@@ -3803,6 +3804,57 @@ elf32_frv_finish_dynamic_symbol (bfd *ou
   return TRUE;
 }
 
+/* Decide whether to attempt to turn absptr or lsda encodings in
+   shared libraries into pcrel within the given input section.  */
+
+static bfd_boolean
+frv_elf_use_relative_eh_frame (bfd *input_bfd,
+			       struct bfd_link_info *info ATTRIBUTE_UNUSED,
+			       asection *eh_frame_section ATTRIBUTE_UNUSED)
+{
+  /* We can't use PC-relative encodings in FDPIC binaries, in general.  */
+  if (elf_elfheader (input_bfd)->e_flags & EF_FRV_FDPIC)
+    return FALSE;
+
+  return TRUE;
+}
+
+/* Adjust the contents of an eh_frame_hdr section before they're output.  */
+
+static bfd_byte
+frv_elf_encode_eh_address (bfd *abfd,
+			   struct bfd_link_info *info,
+			   asection *osec, bfd_vma offset,
+			   asection *loc_sec, bfd_vma loc_offset,
+			   bfd_vma *encoded)
+{
+  struct elf_link_hash_entry *h;
+
+  /* Non-FDPIC binaries can use PC-relative encodings.  */
+  if (! (elf_elfheader (abfd)->e_flags & EF_FRV_FDPIC))
+    return _bfd_elf_encode_eh_address (abfd, info, osec, offset,
+				       loc_sec, loc_offset, encoded);
+
+  h = elf_hash_table (info)->hgot;
+  BFD_ASSERT (h && h->root.type == bfd_link_hash_defined);
+
+  if (! h || (_frv_osec_to_segment (abfd, osec)
+	      == _frv_osec_to_segment (abfd, loc_sec->output_section)))
+    return _bfd_elf_encode_eh_address (abfd, info, osec, offset,
+				       loc_sec, loc_offset, encoded);
+
+  BFD_ASSERT (_frv_osec_to_segment (abfd, osec)
+	      == _frv_osec_to_segment (abfd,
+				       h->root.u.def.section->output_section));
+
+  *encoded = osec->vma + offset
+    - (h->root.u.def.value
+       + h->root.u.def.section->output_section->vma
+       + h->root.u.def.section->output_offset);
+
+  return DW_EH_PE_datarel | DW_EH_PE_sdata4;
+}
+
 /* Look through the relocs for a section during the first phase.
 
    Besides handling virtual table relocs for gc, we have to deal with
@@ -4521,6 +4573,12 @@ frv_elf_print_private_bfd_data (abfd, pt
 #define elf_backend_plt_readonly	1
 #define elf_backend_want_plt_sym	0
 #define elf_backend_plt_header_size	0
+
+#define elf_backend_can_make_relative_eh_frame \
+		frv_elf_use_relative_eh_frame
+#define elf_backend_can_make_lsda_relative_eh_frame \
+		frv_elf_use_relative_eh_frame
+#define elf_backend_encode_eh_address	frv_elf_encode_eh_address
 
 #define elf_backend_may_use_rel_p       1
 #define elf_backend_may_use_rela_p      1
Index: bfd/elfxx-target.h
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-target.h,v
retrieving revision 1.59.4.1
diff -u -p -r1.59.4.1 elfxx-target.h
--- bfd/elfxx-target.h 8 Apr 2004 12:41:46 -0000 1.59.4.1
+++ bfd/elfxx-target.h 6 May 2004 01:53:14 -0000
@@ -401,6 +401,15 @@
 #ifndef elf_backend_ignore_discarded_relocs
 #define elf_backend_ignore_discarded_relocs	NULL
 #endif
+#ifndef elf_backend_can_make_relative_eh_frame
+#define elf_backend_can_make_relative_eh_frame	_bfd_elf_can_make_relative
+#endif
+#ifndef elf_backend_can_make_lsda_relative_eh_frame
+#define elf_backend_can_make_lsda_relative_eh_frame	_bfd_elf_can_make_relative
+#endif
+#ifndef elf_backend_encode_eh_address
+#define elf_backend_encode_eh_address		_bfd_elf_encode_eh_address
+#endif
 #ifndef elf_backend_write_section
 #define elf_backend_write_section		NULL
 #endif
@@ -507,6 +516,9 @@ static const struct elf_backend_data elf
   elf_backend_reloc_type_class,
   elf_backend_discard_info,
   elf_backend_ignore_discarded_relocs,
+  elf_backend_can_make_relative_eh_frame,
+  elf_backend_can_make_lsda_relative_eh_frame,
+  elf_backend_encode_eh_address,
   elf_backend_write_section,
   elf_backend_mips_irix_compat,
   elf_backend_mips_rtype_to_howto,

[-- Attachment #3: Type: text/plain, Size: 188 bytes --]


-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 2.15 branch merge
  2004-04-16 10:09       ` Alexandre Oliva
  2004-04-18  2:02         ` Alexandre Oliva
  2004-04-20 16:29         ` Daniel Jacobowitz
@ 2004-05-06  2:12         ` Alexandre Oliva
  2 siblings, 0 replies; 13+ messages in thread
From: Alexandre Oliva @ 2004-05-06  2:12 UTC (permalink / raw)
  To: Alan Modra; +Cc: binutils, nickc

On Apr 16, 2004, Alexandre Oliva <aoliva@redhat.com> wrote:

> On Apr 12, 2004, Alan Modra <amodra@bigpond.net.au> wrote:
>> On Sat, Apr 10, 2004 at 12:47:15AM -0300, Alexandre Oliva wrote:
>>> I suppose I could create a new bfd arch used for object files that
>>> have the EF_FRV_FDPIC bit set, but this would suck in terms of
>>> duplication of code :-(

>> grep will show you a number of other architectures that include
>> elf32-target two or more times.  Doing that in elf32-frv.c, and making a
>> few tweaks here and there should let you do what you want without much
>> duplication.

> Ah, yes!  Cool, I'd forgotten we could do that.  It's exactly what I
> needed.

> This big patch implements your suggestion.  While at that, I thought
> I'd rename all FDPIC-specific identifiers to make it clear that
> they're FDPIC-only, which made the patch huge.  I attach a separate,
> smaller patch-lookalike that shows all non-mechanical changes
> contained in the patch.  Having a separate BFD vector has enabled
> several simplifications.

> I also include a bug fix: when linking a shared library, we wouldn't
> relocate contents of debugging sections properly.

> I also noticed that the non-PCREL exception handling patch is missing
> from the 2.15 branch.  This means FDPIC is pretty much broken, at
> least for C++, so there's little point in even trying to fix it in the
> branch.  I attach a patch for the branch anyway, after the patch for
> mainline.  They're equivalent except for the changes to the EH-related
> functions that didn't exist in the branch.

> I adjusted the testsuite to accept both bfd vector names, such that
> they'd pass in both frv-elf and frv-uclinux.  The latter defaults to
> -mfdpic in the assembler now; previously, the linker used the
> elf32frvfd emulation but object files assembled directly from source
> didn't get the FDPIC bit set, which could be confusing.

> No regressions in mainline or branch, both frv-elf and frv-uclinux
> tested, the former with --enable-targets=all.

> Is the first bzip2ed attachment ok for mainline?  Is the second ok for
> the branch?

Nick approved this change in private, so I'm checking it in mainline
as well as in the 2.15 branch (per Dan's approval conditioned on
approval for mainline).  The patch for the 2.15 branch doesn't have
the changes for fr405 and fr450 testsuite, since the files aren't
there, but I'm not bothering to post the big patch here one more
time.  The patch for mainline I posted before still applied cleanly in
mainline.  Since the EH-related patch went into the branch now, I'm
using the same patch for mainline.  It needed only two small hunks to
be applied by hand because of conflicts with the fr405 and fr450
support added to mainline in gas/config/tc-frv.c.

-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2004-05-06  2:12 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-09 19:10 2.15 branch merge Daniel Jacobowitz
2004-04-10  2:34 ` Alexandre Oliva
2004-04-10  3:47   ` Daniel Jacobowitz
2004-04-10  3:51   ` Alexandre Oliva
2004-04-10  9:55     ` Daniel Jacobowitz
2004-04-12  0:36       ` Alexandre Oliva
2004-04-12  2:23         ` Daniel Jacobowitz
2004-04-13  3:47     ` Alan Modra
2004-04-16 10:09       ` Alexandre Oliva
2004-04-18  2:02         ` Alexandre Oliva
2004-04-20 16:29         ` Daniel Jacobowitz
2004-05-06  1:57           ` Alexandre Oliva
2004-05-06  2:12         ` Alexandre Oliva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).