Deleted Added
full compact
reloc.c (89857) reloc.c (91041)
1/* BFD support for handling relocation entries.
2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
1/* BFD support for handling relocation entries.
2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3 2000, 2001
3 2000, 2001, 2002
4 Free Software Foundation, Inc.
5 Written by Cygnus Support.
6
7This file is part of BFD, the Binary File Descriptor library.
8
9This program is free software; you can redistribute it and/or modify
10it under the terms of the GNU General Public License as published by
11the Free Software Foundation; either version 2 of the License, or

--- 48 unchanged lines hidden (view full) ---

60 typedef arelent
61
62 This is the structure of a relocation entry:
63
64CODE_FRAGMENT
65.
66.typedef enum bfd_reloc_status
67.{
4 Free Software Foundation, Inc.
5 Written by Cygnus Support.
6
7This file is part of BFD, the Binary File Descriptor library.
8
9This program is free software; you can redistribute it and/or modify
10it under the terms of the GNU General Public License as published by
11the Free Software Foundation; either version 2 of the License, or

--- 48 unchanged lines hidden (view full) ---

60 typedef arelent
61
62 This is the structure of a relocation entry:
63
64CODE_FRAGMENT
65.
66.typedef enum bfd_reloc_status
67.{
68. {* No errors detected *}
68. {* No errors detected. *}
69. bfd_reloc_ok,
70.
69. bfd_reloc_ok,
70.
71. {* The relocation was performed, but there was an overflow. *}
71. {* The relocation was performed, but there was an overflow. *}
72. bfd_reloc_overflow,
73.
72. bfd_reloc_overflow,
73.
74. {* The address to relocate was not within the section supplied. *}
74. {* The address to relocate was not within the section supplied. *}
75. bfd_reloc_outofrange,
76.
75. bfd_reloc_outofrange,
76.
77. {* Used by special functions *}
77. {* Used by special functions. *}
78. bfd_reloc_continue,
79.
78. bfd_reloc_continue,
79.
80. {* Unsupported relocation size requested. *}
80. {* Unsupported relocation size requested. *}
81. bfd_reloc_notsupported,
82.
81. bfd_reloc_notsupported,
82.
83. {* Unused *}
83. {* Unused. *}
84. bfd_reloc_other,
85.
84. bfd_reloc_other,
85.
86. {* The symbol to relocate against was undefined. *}
86. {* The symbol to relocate against was undefined. *}
87. bfd_reloc_undefined,
88.
89. {* The relocation was performed, but may not be ok - presently
90. generated only when linking i960 coff files with i960 b.out
91. symbols. If this type is returned, the error_message argument
92. to bfd_perform_relocation will be set. *}
93. bfd_reloc_dangerous
94. }
95. bfd_reloc_status_type;
96.
97.
98.typedef struct reloc_cache_entry
99.{
87. bfd_reloc_undefined,
88.
89. {* The relocation was performed, but may not be ok - presently
90. generated only when linking i960 coff files with i960 b.out
91. symbols. If this type is returned, the error_message argument
92. to bfd_perform_relocation will be set. *}
93. bfd_reloc_dangerous
94. }
95. bfd_reloc_status_type;
96.
97.
98.typedef struct reloc_cache_entry
99.{
100. {* A pointer into the canonical table of pointers *}
100. {* A pointer into the canonical table of pointers. *}
101. struct symbol_cache_entry **sym_ptr_ptr;
102.
101. struct symbol_cache_entry **sym_ptr_ptr;
102.
103. {* offset in section *}
103. {* offset in section. *}
104. bfd_size_type address;
105.
104. bfd_size_type address;
105.
106. {* addend for relocation value *}
106. {* addend for relocation value. *}
107. bfd_vma addend;
108.
107. bfd_vma addend;
108.
109. {* Pointer to how to perform the required relocation *}
109. {* Pointer to how to perform the required relocation. *}
110. reloc_howto_type *howto;
111.
110. reloc_howto_type *howto;
111.
112.} arelent;
113
112.}
113.arelent;
114.
114*/
115
116/*
117DESCRIPTION
118
119 Here is a description of each of the fields within an <<arelent>>:
120
121 o <<sym_ptr_ptr>>

--- 123 unchanged lines hidden (view full) ---

245
246 Indicates what sort of overflow checking should be done when
247 performing a relocation.
248
249CODE_FRAGMENT
250.
251.enum complain_overflow
252.{
115*/
116
117/*
118DESCRIPTION
119
120 Here is a description of each of the fields within an <<arelent>>:
121
122 o <<sym_ptr_ptr>>

--- 123 unchanged lines hidden (view full) ---

246
247 Indicates what sort of overflow checking should be done when
248 performing a relocation.
249
250CODE_FRAGMENT
251.
252.enum complain_overflow
253.{
253. {* Do not complain on overflow. *}
254. {* Do not complain on overflow. *}
254. complain_overflow_dont,
255.
256. {* Complain if the bitfield overflows, whether it is considered
255. complain_overflow_dont,
256.
257. {* Complain if the bitfield overflows, whether it is considered
257. as signed or unsigned. *}
258. as signed or unsigned. *}
258. complain_overflow_bitfield,
259.
260. {* Complain if the value overflows when considered as signed
259. complain_overflow_bitfield,
260.
261. {* Complain if the value overflows when considered as signed
261. number. *}
262. number. *}
262. complain_overflow_signed,
263.
264. {* Complain if the value overflows when considered as an
263. complain_overflow_signed,
264.
265. {* Complain if the value overflows when considered as an
265. unsigned number. *}
266. unsigned number. *}
266. complain_overflow_unsigned
267.};
268
269*/
270
271/*
272SUBSUBSECTION
273 <<reloc_howto_type>>
274
275 The <<reloc_howto_type>> is a structure which contains all the
276 information that libbfd needs to know to tie up a back end's data.
277
278CODE_FRAGMENT
267. complain_overflow_unsigned
268.};
269
270*/
271
272/*
273SUBSUBSECTION
274 <<reloc_howto_type>>
275
276 The <<reloc_howto_type>> is a structure which contains all the
277 information that libbfd needs to know to tie up a back end's data.
278
279CODE_FRAGMENT
279.struct symbol_cache_entry; {* Forward declaration *}
280.struct symbol_cache_entry; {* Forward declaration. *}
280.
281.struct reloc_howto_struct
282.{
283. {* The type field has mainly a documentary use - the back end can
284. do what it wants with it, though normally the back end's
285. external idea of what a reloc number is stored
286. in this field. For example, a PC relative word relocation
287. in a coff environment has the type 023 - because that's

--- 73 unchanged lines hidden (view full) ---

361. {* When some formats create PC relative instructions, they leave
362. the value of the pc of the place being relocated in the offset
363. slot of the instruction, so that a PC relative relocation can
364. be made just by adding in an ordinary offset (e.g., sun3 a.out).
365. Some formats leave the displacement part of an instruction
366. empty (e.g., m88k bcs); this flag signals the fact. *}
367. boolean pcrel_offset;
368.};
281.
282.struct reloc_howto_struct
283.{
284. {* The type field has mainly a documentary use - the back end can
285. do what it wants with it, though normally the back end's
286. external idea of what a reloc number is stored
287. in this field. For example, a PC relative word relocation
288. in a coff environment has the type 023 - because that's

--- 73 unchanged lines hidden (view full) ---

362. {* When some formats create PC relative instructions, they leave
363. the value of the pc of the place being relocated in the offset
364. slot of the instruction, so that a PC relative relocation can
365. be made just by adding in an ordinary offset (e.g., sun3 a.out).
366. Some formats leave the displacement part of an instruction
367. empty (e.g., m88k bcs); this flag signals the fact. *}
368. boolean pcrel_offset;
369.};
369
370.
370*/
371
372/*
373FUNCTION
374 The HOWTO Macro
375
376DESCRIPTION
377 The HOWTO define is horrible and will go away.

--- 30 unchanged lines hidden (view full) ---

408. relocation = 0; \
409. } \
410. else \
411. { \
412. relocation = symbol->value; \
413. } \
414. } \
415. }
371*/
372
373/*
374FUNCTION
375 The HOWTO Macro
376
377DESCRIPTION
378 The HOWTO define is horrible and will go away.

--- 30 unchanged lines hidden (view full) ---

409. relocation = 0; \
410. } \
411. else \
412. { \
413. relocation = symbol->value; \
414. } \
415. } \
416. }
416
417.
417*/
418
419/*
420FUNCTION
421 bfd_get_reloc_size
422
423SYNOPSIS
424 unsigned int bfd_get_reloc_size (reloc_howto_type *);

--- 27 unchanged lines hidden (view full) ---

452DESCRIPTION
453
454 How relocs are tied together in an <<asection>>:
455
456.typedef struct relent_chain
457.{
458. arelent relent;
459. struct relent_chain *next;
418*/
419
420/*
421FUNCTION
422 bfd_get_reloc_size
423
424SYNOPSIS
425 unsigned int bfd_get_reloc_size (reloc_howto_type *);

--- 27 unchanged lines hidden (view full) ---

453DESCRIPTION
454
455 How relocs are tied together in an <<asection>>:
456
457.typedef struct relent_chain
458.{
459. arelent relent;
460. struct relent_chain *next;
460.} arelent_chain;
461
461.}
462.arelent_chain;
463.
462*/
463
464/* N_ONES produces N one bits, without overflowing machine arithmetic. */
465#define N_ONES(n) (((((bfd_vma) 1 << ((n) - 1)) - 1) << 1) | 1)
466
467/*
468FUNCTION
469 bfd_check_overflow

--- 344 unchanged lines hidden (view full) ---

814 if (howto->complain_on_overflow != complain_overflow_dont
815 && flag == bfd_reloc_ok)
816 flag = bfd_check_overflow (howto->complain_on_overflow,
817 howto->bitsize,
818 howto->rightshift,
819 bfd_arch_bits_per_address (abfd),
820 relocation);
821
464*/
465
466/* N_ONES produces N one bits, without overflowing machine arithmetic. */
467#define N_ONES(n) (((((bfd_vma) 1 << ((n) - 1)) - 1) << 1) | 1)
468
469/*
470FUNCTION
471 bfd_check_overflow

--- 344 unchanged lines hidden (view full) ---

816 if (howto->complain_on_overflow != complain_overflow_dont
817 && flag == bfd_reloc_ok)
818 flag = bfd_check_overflow (howto->complain_on_overflow,
819 howto->bitsize,
820 howto->rightshift,
821 bfd_arch_bits_per_address (abfd),
822 relocation);
823
822 /*
823 Either we are relocating all the way, or we don't want to apply
824 the relocation to the reloc entry (probably because there isn't
825 any room in the output format to describe addends to relocs)
826 */
824 /* Either we are relocating all the way, or we don't want to apply
825 the relocation to the reloc entry (probably because there isn't
826 any room in the output format to describe addends to relocs). */
827
828 /* The cast to bfd_vma avoids a bug in the Alpha OSF/1 C compiler
829 (OSF version 1.3, compiler version 3.11). It miscompiles the
830 following program:
831
832 struct str
833 {
834 unsigned int i0;

--- 10 unchanged lines hidden (view full) ---

845 printf ("failed\n");
846 else
847 printf ("succeeded (%lx)\n", x);
848 }
849 */
850
851 relocation >>= (bfd_vma) howto->rightshift;
852
827
828 /* The cast to bfd_vma avoids a bug in the Alpha OSF/1 C compiler
829 (OSF version 1.3, compiler version 3.11). It miscompiles the
830 following program:
831
832 struct str
833 {
834 unsigned int i0;

--- 10 unchanged lines hidden (view full) ---

845 printf ("failed\n");
846 else
847 printf ("succeeded (%lx)\n", x);
848 }
849 */
850
851 relocation >>= (bfd_vma) howto->rightshift;
852
853 /* Shift everything up to where it's going to be used */
854
853 /* Shift everything up to where it's going to be used. */
855 relocation <<= (bfd_vma) howto->bitpos;
856
854 relocation <<= (bfd_vma) howto->bitpos;
855
857 /* Wait for the day when all have the mask in them */
856 /* Wait for the day when all have the mask in them. */
858
859 /* What we do:
860 i instruction to be left alone
861 o offset within instruction
862 r relocation offset to apply
863 S src mask
864 D dst mask
865 N ~dst mask

--- 104 unchanged lines hidden (view full) ---

970DESCRIPTION
971 This looks remarkably like <<bfd_perform_relocation>>, except it
972 does not expect that the section contents have been filled in.
973 I.e., it's suitable for use when creating, rather than applying
974 a relocation.
975
976 For now, this function should be considered reserved for the
977 assembler.
857
858 /* What we do:
859 i instruction to be left alone
860 o offset within instruction
861 r relocation offset to apply
862 S src mask
863 D dst mask
864 N ~dst mask

--- 104 unchanged lines hidden (view full) ---

969DESCRIPTION
970 This looks remarkably like <<bfd_perform_relocation>>, except it
971 does not expect that the section contents have been filled in.
972 I.e., it's suitable for use when creating, rather than applying
973 a relocation.
974
975 For now, this function should be considered reserved for the
976 assembler.
978
979*/
980
981bfd_reloc_status_type
982bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset,
983 input_section, error_message)
984 bfd *abfd;
985 arelent *reloc_entry;
986 PTR data_start;

--- 113 unchanged lines hidden (view full) ---

1100 }
1101 else
1102 {
1103 /* This is a partial relocation, but inplace, so modify the
1104 reloc record a bit.
1105
1106 If we've relocated with a symbol with a section, change
1107 into a ref to the section belonging to the symbol. */
977*/
978
979bfd_reloc_status_type
980bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset,
981 input_section, error_message)
982 bfd *abfd;
983 arelent *reloc_entry;
984 PTR data_start;

--- 113 unchanged lines hidden (view full) ---

1098 }
1099 else
1100 {
1101 /* This is a partial relocation, but inplace, so modify the
1102 reloc record a bit.
1103
1104 If we've relocated with a symbol with a section, change
1105 into a ref to the section belonging to the symbol. */
1108
1109 reloc_entry->address += input_section->output_offset;
1110
1111 /* WTF?? */
1112 if (abfd->xvec->flavour == bfd_target_coff_flavour
1113 && strcmp (abfd->xvec->name, "coff-Intel-little") != 0
1114 && strcmp (abfd->xvec->name, "coff-Intel-big") != 0)
1115 {
1116#if 1

--- 59 unchanged lines hidden (view full) ---

1176 for all the supported targets would be available in
1177 /usr/cygnus/progressive/H-host/target/lib/libc.a).
1178 3) make the change to reloc.c
1179 4) rebuild the linker
1180 5) repeat step 2
1181 6) if the resulting object files are the same, you have at least
1182 made it no worse
1183 7) if they are different you have to figure out which version is
1106 reloc_entry->address += input_section->output_offset;
1107
1108 /* WTF?? */
1109 if (abfd->xvec->flavour == bfd_target_coff_flavour
1110 && strcmp (abfd->xvec->name, "coff-Intel-little") != 0
1111 && strcmp (abfd->xvec->name, "coff-Intel-big") != 0)
1112 {
1113#if 1

--- 59 unchanged lines hidden (view full) ---

1173 for all the supported targets would be available in
1174 /usr/cygnus/progressive/H-host/target/lib/libc.a).
1175 3) make the change to reloc.c
1176 4) rebuild the linker
1177 5) repeat step 2
1178 6) if the resulting object files are the same, you have at least
1179 made it no worse
1180 7) if they are different you have to figure out which version is
1184 right
1185*/
1181 right. */
1186 relocation -= reloc_entry->addend;
1187#endif
1188 reloc_entry->addend = 0;
1189 }
1190 else
1191 {
1192 reloc_entry->addend = relocation;
1193 }

--- 8 unchanged lines hidden (view full) ---

1202 adding in the value contained in the object file. */
1203 if (howto->complain_on_overflow != complain_overflow_dont)
1204 flag = bfd_check_overflow (howto->complain_on_overflow,
1205 howto->bitsize,
1206 howto->rightshift,
1207 bfd_arch_bits_per_address (abfd),
1208 relocation);
1209
1182 relocation -= reloc_entry->addend;
1183#endif
1184 reloc_entry->addend = 0;
1185 }
1186 else
1187 {
1188 reloc_entry->addend = relocation;
1189 }

--- 8 unchanged lines hidden (view full) ---

1198 adding in the value contained in the object file. */
1199 if (howto->complain_on_overflow != complain_overflow_dont)
1200 flag = bfd_check_overflow (howto->complain_on_overflow,
1201 howto->bitsize,
1202 howto->rightshift,
1203 bfd_arch_bits_per_address (abfd),
1204 relocation);
1205
1210 /*
1211 Either we are relocating all the way, or we don't want to apply
1212 the relocation to the reloc entry (probably because there isn't
1213 any room in the output format to describe addends to relocs)
1214 */
1206 /* Either we are relocating all the way, or we don't want to apply
1207 the relocation to the reloc entry (probably because there isn't
1208 any room in the output format to describe addends to relocs). */
1215
1216 /* The cast to bfd_vma avoids a bug in the Alpha OSF/1 C compiler
1217 (OSF version 1.3, compiler version 3.11). It miscompiles the
1218 following program:
1219
1220 struct str
1221 {
1222 unsigned int i0;

--- 10 unchanged lines hidden (view full) ---

1233 printf ("failed\n");
1234 else
1235 printf ("succeeded (%lx)\n", x);
1236 }
1237 */
1238
1239 relocation >>= (bfd_vma) howto->rightshift;
1240
1209
1210 /* The cast to bfd_vma avoids a bug in the Alpha OSF/1 C compiler
1211 (OSF version 1.3, compiler version 3.11). It miscompiles the
1212 following program:
1213
1214 struct str
1215 {
1216 unsigned int i0;

--- 10 unchanged lines hidden (view full) ---

1227 printf ("failed\n");
1228 else
1229 printf ("succeeded (%lx)\n", x);
1230 }
1231 */
1232
1233 relocation >>= (bfd_vma) howto->rightshift;
1234
1241 /* Shift everything up to where it's going to be used */
1242
1235 /* Shift everything up to where it's going to be used. */
1243 relocation <<= (bfd_vma) howto->bitpos;
1244
1236 relocation <<= (bfd_vma) howto->bitpos;
1237
1245 /* Wait for the day when all have the mask in them */
1238 /* Wait for the day when all have the mask in them. */
1246
1247 /* What we do:
1248 i instruction to be left alone
1249 o offset within instruction
1250 r relocation offset to apply
1251 S src mask
1252 D dst mask
1253 N ~dst mask

--- 704 unchanged lines hidden (view full) ---

1958 BFD_RELOC_ALPHA_GPREL_HI16
1959ENUMX
1960 BFD_RELOC_ALPHA_GPREL_LO16
1961ENUMDOC
1962 The GPREL_HI/LO relocations together form a 32-bit offset from the
1963 GP register.
1964
1965ENUM
1239
1240 /* What we do:
1241 i instruction to be left alone
1242 o offset within instruction
1243 r relocation offset to apply
1244 S src mask
1245 D dst mask
1246 N ~dst mask

--- 704 unchanged lines hidden (view full) ---

1951 BFD_RELOC_ALPHA_GPREL_HI16
1952ENUMX
1953 BFD_RELOC_ALPHA_GPREL_LO16
1954ENUMDOC
1955 The GPREL_HI/LO relocations together form a 32-bit offset from the
1956 GP register.
1957
1958ENUM
1959 BFD_RELOC_ALPHA_BRSGP
1960ENUMDOC
1961 Like BFD_RELOC_23_PCREL_S2, except that the source and target must
1962 share a common GP, and the target address is adjusted for
1963 STO_ALPHA_STD_GPLOAD.
1964
1965ENUM
1966 BFD_RELOC_MIPS_JMP
1967ENUMDOC
1968 Bits 27..2 of the relocation address shifted right 2 bits;
1969 simple reloc otherwise.
1970
1971ENUM
1972 BFD_RELOC_MIPS16_JMP
1973ENUMDOC

--- 71 unchanged lines hidden (view full) ---

2045 BFD_RELOC_MIPS_SCN_DISP
2046ENUMX
2047 BFD_RELOC_MIPS_REL16
2048ENUMX
2049 BFD_RELOC_MIPS_RELGOT
2050ENUMX
2051 BFD_RELOC_MIPS_JALR
2052COMMENT
1966 BFD_RELOC_MIPS_JMP
1967ENUMDOC
1968 Bits 27..2 of the relocation address shifted right 2 bits;
1969 simple reloc otherwise.
1970
1971ENUM
1972 BFD_RELOC_MIPS16_JMP
1973ENUMDOC

--- 71 unchanged lines hidden (view full) ---

2045 BFD_RELOC_MIPS_SCN_DISP
2046ENUMX
2047 BFD_RELOC_MIPS_REL16
2048ENUMX
2049 BFD_RELOC_MIPS_RELGOT
2050ENUMX
2051 BFD_RELOC_MIPS_JALR
2052COMMENT
2053COMMENT
2054ENUMX
2055 BFD_RELOC_SH_GOT_LOW16
2056ENUMX
2057 BFD_RELOC_SH_GOT_MEDLOW16
2058ENUMX
2059 BFD_RELOC_SH_GOT_MEDHI16
2060ENUMX
2061 BFD_RELOC_SH_GOT_HI16
2062ENUMX
2063 BFD_RELOC_SH_GOTPLT_LOW16
2064ENUMX
2065 BFD_RELOC_SH_GOTPLT_MEDLOW16
2066ENUMX
2067 BFD_RELOC_SH_GOTPLT_MEDHI16
2068ENUMX
2069 BFD_RELOC_SH_GOTPLT_HI16
2070ENUMX
2071 BFD_RELOC_SH_PLT_LOW16
2072ENUMX
2073 BFD_RELOC_SH_PLT_MEDLOW16
2074ENUMX
2075 BFD_RELOC_SH_PLT_MEDHI16
2076ENUMX
2077 BFD_RELOC_SH_PLT_HI16
2078ENUMX
2079 BFD_RELOC_SH_GOTOFF_LOW16
2080ENUMX
2081 BFD_RELOC_SH_GOTOFF_MEDLOW16
2082ENUMX
2083 BFD_RELOC_SH_GOTOFF_MEDHI16
2084ENUMX
2085 BFD_RELOC_SH_GOTOFF_HI16
2086ENUMX
2087 BFD_RELOC_SH_GOTPC_LOW16
2088ENUMX
2089 BFD_RELOC_SH_GOTPC_MEDLOW16
2090ENUMX
2091 BFD_RELOC_SH_GOTPC_MEDHI16
2092ENUMX
2093 BFD_RELOC_SH_GOTPC_HI16
2094ENUMX
2095 BFD_RELOC_SH_COPY64
2096ENUMX
2097 BFD_RELOC_SH_GLOB_DAT64
2098ENUMX
2099 BFD_RELOC_SH_JMP_SLOT64
2100ENUMX
2101 BFD_RELOC_SH_RELATIVE64
2102ENUMX
2103 BFD_RELOC_SH_GOT10BY4
2104ENUMX
2105 BFD_RELOC_SH_GOT10BY8
2106ENUMX
2107 BFD_RELOC_SH_GOTPLT10BY4
2108ENUMX
2109 BFD_RELOC_SH_GOTPLT10BY8
2110ENUMX
2111 BFD_RELOC_SH_GOTPLT32
2112COMMENT
2113ENUMX
2114 BFD_RELOC_SH_SHMEDIA_CODE
2115ENUMX
2116 BFD_RELOC_SH_IMMU5
2117ENUMX
2118 BFD_RELOC_SH_IMMS6
2119ENUMX
2120 BFD_RELOC_SH_IMMS6BY32
2121ENUMX
2122 BFD_RELOC_SH_IMMU6
2123ENUMX
2124 BFD_RELOC_SH_IMMS10
2125ENUMX
2126 BFD_RELOC_SH_IMMS10BY2
2127ENUMX
2128 BFD_RELOC_SH_IMMS10BY4
2129ENUMX
2130 BFD_RELOC_SH_IMMS10BY8
2131ENUMX
2132 BFD_RELOC_SH_IMMS16
2133ENUMX
2134 BFD_RELOC_SH_IMMU16
2135ENUMX
2136 BFD_RELOC_SH_IMM_LOW16
2137ENUMX
2138 BFD_RELOC_SH_IMM_LOW16_PCREL
2139ENUMX
2140 BFD_RELOC_SH_IMM_MEDLOW16
2141ENUMX
2142 BFD_RELOC_SH_IMM_MEDLOW16_PCREL
2143ENUMX
2144 BFD_RELOC_SH_IMM_MEDHI16
2145ENUMX
2146 BFD_RELOC_SH_IMM_MEDHI16_PCREL
2147ENUMX
2148 BFD_RELOC_SH_IMM_HI16
2149ENUMX
2150 BFD_RELOC_SH_IMM_HI16_PCREL
2151ENUMX
2152 BFD_RELOC_SH_PT_16
2153COMMENT
2053ENUMDOC
2054 MIPS ELF relocations.
2055
2056COMMENT
2057
2058ENUM
2059 BFD_RELOC_386_GOT32
2060ENUMX

--- 1308 unchanged lines hidden (view full) ---

3369 struct bfd_link_info *,
3370 boolean *);
3371
3372DESCRIPTION
3373 Provides default handling for relaxing for back ends which
3374 don't do relaxing -- i.e., does nothing.
3375*/
3376
2154ENUMDOC
2155 MIPS ELF relocations.
2156
2157COMMENT
2158
2159ENUM
2160 BFD_RELOC_386_GOT32
2161ENUMX

--- 1308 unchanged lines hidden (view full) ---

3470 struct bfd_link_info *,
3471 boolean *);
3472
3473DESCRIPTION
3474 Provides default handling for relaxing for back ends which
3475 don't do relaxing -- i.e., does nothing.
3476*/
3477
3377/*ARGSUSED*/
3378boolean
3379bfd_generic_relax_section (abfd, section, link_info, again)
3380 bfd *abfd ATTRIBUTE_UNUSED;
3381 asection *section ATTRIBUTE_UNUSED;
3382 struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
3383 boolean *again;
3384{
3385 *again = false;

--- 8 unchanged lines hidden (view full) ---

3394 boolean bfd_generic_gc_sections
3395 (bfd *, struct bfd_link_info *);
3396
3397DESCRIPTION
3398 Provides default handling for relaxing for back ends which
3399 don't do section gc -- i.e., does nothing.
3400*/
3401
3478boolean
3479bfd_generic_relax_section (abfd, section, link_info, again)
3480 bfd *abfd ATTRIBUTE_UNUSED;
3481 asection *section ATTRIBUTE_UNUSED;
3482 struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
3483 boolean *again;
3484{
3485 *again = false;

--- 8 unchanged lines hidden (view full) ---

3494 boolean bfd_generic_gc_sections
3495 (bfd *, struct bfd_link_info *);
3496
3497DESCRIPTION
3498 Provides default handling for relaxing for back ends which
3499 don't do section gc -- i.e., does nothing.
3500*/
3501
3402/*ARGSUSED*/
3403boolean
3404bfd_generic_gc_sections (abfd, link_info)
3405 bfd *abfd ATTRIBUTE_UNUSED;
3406 struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
3407{
3408 return true;
3409}
3410

--- 5 unchanged lines hidden (view full) ---

3416 boolean bfd_generic_merge_sections
3417 (bfd *, struct bfd_link_info *);
3418
3419DESCRIPTION
3420 Provides default handling for SEC_MERGE section merging for back ends
3421 which don't have SEC_MERGE support -- i.e., does nothing.
3422*/
3423
3502boolean
3503bfd_generic_gc_sections (abfd, link_info)
3504 bfd *abfd ATTRIBUTE_UNUSED;
3505 struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
3506{
3507 return true;
3508}
3509

--- 5 unchanged lines hidden (view full) ---

3515 boolean bfd_generic_merge_sections
3516 (bfd *, struct bfd_link_info *);
3517
3518DESCRIPTION
3519 Provides default handling for SEC_MERGE section merging for back ends
3520 which don't have SEC_MERGE support -- i.e., does nothing.
3521*/
3522
3424/*ARGSUSED*/
3425boolean
3426bfd_generic_merge_sections (abfd, link_info)
3427 bfd *abfd ATTRIBUTE_UNUSED;
3428 struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
3429{
3430 return true;
3431}
3432

--- 21 unchanged lines hidden (view full) ---

3454 relocateable, symbols)
3455 bfd *abfd;
3456 struct bfd_link_info *link_info;
3457 struct bfd_link_order *link_order;
3458 bfd_byte *data;
3459 boolean relocateable;
3460 asymbol **symbols;
3461{
3523boolean
3524bfd_generic_merge_sections (abfd, link_info)
3525 bfd *abfd ATTRIBUTE_UNUSED;
3526 struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
3527{
3528 return true;
3529}
3530

--- 21 unchanged lines hidden (view full) ---

3552 relocateable, symbols)
3553 bfd *abfd;
3554 struct bfd_link_info *link_info;
3555 struct bfd_link_order *link_order;
3556 bfd_byte *data;
3557 boolean relocateable;
3558 asymbol **symbols;
3559{
3462 /* Get enough memory to hold the stuff */
3560 /* Get enough memory to hold the stuff. */
3463 bfd *input_bfd = link_order->u.indirect.section->owner;
3464 asection *input_section = link_order->u.indirect.section;
3465
3466 long reloc_size = bfd_get_reloc_upper_bound (input_bfd, input_section);
3467 arelent **reloc_vector = NULL;
3468 long reloc_count;
3469
3470 if (reloc_size < 0)
3471 goto error_return;
3472
3473 reloc_vector = (arelent **) bfd_malloc ((bfd_size_type) reloc_size);
3474 if (reloc_vector == NULL && reloc_size != 0)
3475 goto error_return;
3476
3561 bfd *input_bfd = link_order->u.indirect.section->owner;
3562 asection *input_section = link_order->u.indirect.section;
3563
3564 long reloc_size = bfd_get_reloc_upper_bound (input_bfd, input_section);
3565 arelent **reloc_vector = NULL;
3566 long reloc_count;
3567
3568 if (reloc_size < 0)
3569 goto error_return;
3570
3571 reloc_vector = (arelent **) bfd_malloc ((bfd_size_type) reloc_size);
3572 if (reloc_vector == NULL && reloc_size != 0)
3573 goto error_return;
3574
3477 /* read in the section */
3575 /* Read in the section. */
3478 if (!bfd_get_section_contents (input_bfd,
3479 input_section,
3480 (PTR) data,
3481 (bfd_vma) 0,
3482 input_section->_raw_size))
3483 goto error_return;
3484
3576 if (!bfd_get_section_contents (input_bfd,
3577 input_section,
3578 (PTR) data,
3579 (bfd_vma) 0,
3580 input_section->_raw_size))
3581 goto error_return;
3582
3485 /* We're not relaxing the section, so just copy the size info */
3583 /* We're not relaxing the section, so just copy the size info. */
3486 input_section->_cooked_size = input_section->_raw_size;
3487 input_section->reloc_done = true;
3488
3489 reloc_count = bfd_canonicalize_reloc (input_bfd,
3490 input_section,
3491 reloc_vector,
3492 symbols);
3493 if (reloc_count < 0)

--- 13 unchanged lines hidden (view full) ---

3507 input_section,
3508 relocateable ? abfd : (bfd *) NULL,
3509 &error_message);
3510
3511 if (relocateable)
3512 {
3513 asection *os = input_section->output_section;
3514
3584 input_section->_cooked_size = input_section->_raw_size;
3585 input_section->reloc_done = true;
3586
3587 reloc_count = bfd_canonicalize_reloc (input_bfd,
3588 input_section,
3589 reloc_vector,
3590 symbols);
3591 if (reloc_count < 0)

--- 13 unchanged lines hidden (view full) ---

3605 input_section,
3606 relocateable ? abfd : (bfd *) NULL,
3607 &error_message);
3608
3609 if (relocateable)
3610 {
3611 asection *os = input_section->output_section;
3612
3515 /* A partial link, so keep the relocs */
3613 /* A partial link, so keep the relocs. */
3516 os->orelocation[os->reloc_count] = *parent;
3517 os->reloc_count++;
3518 }
3519
3520 if (r != bfd_reloc_ok)
3521 {
3522 switch (r)
3523 {

--- 39 unchanged lines hidden ---
3614 os->orelocation[os->reloc_count] = *parent;
3615 os->reloc_count++;
3616 }
3617
3618 if (r != bfd_reloc_ok)
3619 {
3620 switch (r)
3621 {

--- 39 unchanged lines hidden ---