This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Support %r_disp{8,16,32,64} and %r_plt{32,64} on SPARC


On Fri, Dec 21, 2001 at 04:12:05PM +0100, Jakub Jelinek wrote:
> In gcc, I'm afraid we'll need to:
> 1) add configure check for working unaligned %r_disp32() (ie. not Solaris as)
> 2) if assembler has working unaligned %r_disp32(), use
>    DW_EH_PE_pcrel|DW_EH_PE_sdata4 as preferred format for shared libs,
>    otherwise on Solaris use DW_EH_PE_aligned
>    due to ld.so bugs and elsewhere DW_EH_PE_absptr.

Most unfortunate, but I agree that there doesn't seem to be an
alternative.  Someone should report the linker bug to Sun; maybe
they can get it fixed for 2.9 or something.

> 	* elf32-sparc.c (_bfd_sparc_elf_howto_table): Fix dst_mask for
> 	R_SPARC_DISP32.  Support R_SPARC_PLT32.
> 	(sparc_reloc_map): Add BFD_RELOC_16_PCREL and BFD_RELOC_SPARC_PLT32.
> 	(elf32_sparc_check_relocs): Handle R_SPARC_PLT32.
> 	(elf32_sparc_relocate_section): Likewise.
> 	* elf64-sparc.c (sparc64_elf_howto_table): Fix dst_mask for
> 	R_SPARC_DISP32.  Support R_SPARC_PLT32 and R_SPARC_PLT64.
> 	(sparc_reloc_map): Add BFD_RELOC_16_PCREL, BFD_RELOC_64_PCREL
> 	and BFD_RELOC_SPARC_PLT32.
> 	(sparc64_elf_check_relocs): Handle R_SPARC_PLT32 and R_SPARC_PLT64.
> 	(sparc64_elf_relocate_section): Likewise.
> 	* reloc.c (bfd_reloc_code_type): Add BFD_RELOC_SPARC_PLT32.
> 	* bfd-in2.h, libbfd.h: Rebuilt.
> 
> 	* config/tc-sparc.h (TC_PARSE_CONS_EXPRESSION): Define.
> 	(sparc_cons): Provide prototype.
> 	* config/tc-sparc.c (tc_gen_reloc): Handle BFD_RELOC_*_PCREL and
> 	BFD_RELOC_SPARC_PLT{32,64}.  Enumerate for which relocs
> 	reloc->addend = fixp->fx_addnumber shouldn't be done instead of
> 	enumarating for which pc relative ones it should be done.
> 	(sparc_cons_special_reloc): New variable.
> 	(sparc_cons): New function.
> 	(cons_fix_new_sparc): Use sparc_cons_special_reloc.
> 	* testsuite/gas/sparc/pcrel.s: New test.
> 	* testsuite/gas/sparc/pcrel.d: Expected output.
> 	* testsuite/gas/sparc/pcrel64.s: New test.
> 	* testsuite/gas/sparc/pcrel64.d: Expected output.
> 	* testsuite/gas/sparc/plt.s: New test.
> 	* testsuite/gas/sparc/plt.d: Expected output.
> 	* testsuite/gas/sparc/plt64.s: New test.
> 	* testsuite/gas/sparc/plt64.d: Expected output.
> 	* testsuite/gas/sparc/sparc.exp: Add pcrel, pcrel64, plt and plt64
> 	tests.

Ok.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]