Develop and Download Open Source Software

Browse Subversion Repository

Diff of /trunk/bfd/elf-m10300.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 20 by monabuilder, Sun Dec 7 02:23:44 2008 UTC revision 21 by monamour, Mon Jul 27 20:34:36 2009 UTC
# Line 1493  mn10300_elf_relocate_section (bfd *outpu Line 1493  mn10300_elf_relocate_section (bfd *outpu
1493                        /* _32 relocs in executables force _COPY relocs,                        /* _32 relocs in executables force _COPY relocs,
1494                           such that the address of the symbol ends up                           such that the address of the symbol ends up
1495                           being local.  */                           being local.  */
1496                        && !info->executable                                            && !info->executable
1497                        && !SYMBOL_REFERENCES_LOCAL (info, hh)                        && !SYMBOL_REFERENCES_LOCAL (info, hh)
1498                        && ((input_section->flags & SEC_ALLOC) != 0                        && ((input_section->flags & SEC_ALLOC) != 0
1499                            /* DWARF will emit R_MN10300_32 relocations                            /* DWARF will emit R_MN10300_32 relocations
# Line 2073  mn10300_elf_relax_section (bfd *abfd, Line 2073  mn10300_elf_relax_section (bfd *abfd,
2073    asection *section = sec;    asection *section = sec;
2074    bfd_vma align_gap_adjustment;    bfd_vma align_gap_adjustment;
2075    
2076      if (link_info->relocatable)
2077        (*link_info->callbacks->einfo)
2078          (_("%P%F: --relax and -r may not be used together\n"));
2079    
2080    /* Assume nothing changes.  */    /* Assume nothing changes.  */
2081    *again = FALSE;    *again = FALSE;
2082    
# Line 2777  mn10300_elf_relax_section (bfd *abfd, Line 2781  mn10300_elf_relax_section (bfd *abfd,
2781                                                        isym->st_name);                                                        isym->st_name);
2782    
2783            if ((sym_sec->flags & SEC_MERGE)            if ((sym_sec->flags & SEC_MERGE)
               && ELF_ST_TYPE (isym->st_info) == STT_SECTION  
2784                && sym_sec->sec_info_type == ELF_INFO_TYPE_MERGE)                && sym_sec->sec_info_type == ELF_INFO_TYPE_MERGE)
2785              {              {
2786                symval = isym->st_value + irel->r_addend;                symval = isym->st_value;
2787    
2788                  /* GAS may reduce relocations against symbols in SEC_MERGE
2789                     sections to a relocation against the section symbol when
2790                     the original addend was zero.  When the reloc is against
2791                     a section symbol we should include the addend in the
2792                     offset passed to _bfd_merged_section_offset, since the
2793                     location of interest is the original symbol.  On the
2794                     other hand, an access to "sym+addend" where "sym" is not
2795                     a section symbol should not include the addend;  Such an
2796                     access is presumed to be an offset from "sym";  The
2797                     location of interest is just "sym".  */
2798                  if (ELF_ST_TYPE (isym->st_info) == STT_SECTION)
2799                    symval += irel->r_addend;
2800    
2801                symval = _bfd_merged_section_offset (abfd, & sym_sec,                symval = _bfd_merged_section_offset (abfd, & sym_sec,
2802                                                     elf_section_data (sym_sec)->sec_info,                                                     elf_section_data (sym_sec)->sec_info,
2803                                                     symval);                                                     symval);
2804                symval += sym_sec->output_section->vma + sym_sec->output_offset - irel->r_addend;  
2805                  if (ELF_ST_TYPE (isym->st_info) != STT_SECTION)
2806                    symval += irel->r_addend;
2807    
2808                  symval += sym_sec->output_section->vma
2809                    + sym_sec->output_offset - irel->r_addend;
2810              }              }
2811            else            else
2812              symval = (isym->st_value              symval = (isym->st_value

Legend:
Removed from v.20  
changed lines
  Added in v.21

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26