]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - include/coff/xcoff.h
aix: implement TLS relocation for gas and ld
[thirdparty/binutils-gdb.git] / include / coff / xcoff.h
1 /* Internal format of XCOFF object file data structures for BFD.
2
3 Copyright (C) 1995-2021 Free Software Foundation, Inc.
4 Written by Ian Lance Taylor <ian@cygnus.com>, Cygnus Support.
5
6 This file is part of BFD, the Binary File Descriptor library.
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
21 MA 02110-1301, USA. */
22
23 #ifndef _INTERNAL_XCOFF_H
24 #define _INTERNAL_XCOFF_H
25
26 /* XCOFF specific f_flags. */
27
28 /* File was profiled with fdpr. */
29 #define F_FDPR_PROF 0x0010
30
31 /* File was reordered with fdpr. */
32 #define F_FDPR_OPTI 0x0020
33
34 /* File use very large program support. */
35 #define F_DSA 0x0040
36
37 /* One aux header specifying medium page sizes is non-zero. */
38 #define F_VARPG 0x0100
39
40 /* Read/write sections are non-executable. */
41 #define F_NONEXEC 0x8000
42
43 /* Linker */
44
45 /* Names of "special" sections. */
46 #define _TEXT ".text"
47 #define _DATA ".data"
48 #define _BSS ".bss"
49 #define _TDATA ".tdata"
50 #define _TBSS ".tbss"
51 #define _PAD ".pad"
52 #define _LOADER ".loader"
53 #define _EXCEPT ".except"
54 #define _TYPCHK ".typchk"
55
56 /* XCOFF uses special .dwXXX sections with the type STYP_DWARF. */
57 #define STYP_DWARF 0x0010
58
59 /* High-order 16-bits dwarf subtypes. */
60 #define SSUBTYP_DWINFO 0x10000
61 #define SSUBTYP_DWLINE 0x20000
62 #define SSUBTYP_DWPBNMS 0x30000
63 #define SSUBTYP_DWPBTYP 0x40000
64 #define SSUBTYP_DWARNGE 0x50000
65 #define SSUBTYP_DWABREV 0x60000
66 #define SSUBTYP_DWSTR 0x70000
67 #define SSUBTYP_DWRNGES 0x80000
68
69 /* XCOFF uses a special .loader section with type STYP_LOADER. */
70 #define STYP_LOADER 0x1000
71
72 /* Specifies an exception section. A section of this type provides
73 information to identify the reason that a trap or ececptin occured within
74 and executable object program */
75 #define STYP_EXCEPT 0x0100
76
77 /* Specifies an initialized thread-local data section. */
78 #define STYP_TDATA 0x0400
79
80 /* Specifies an uninitialized thread-local data section. */
81 #define STYP_TBSS 0x0800
82
83 /* XCOFF uses a special .debug section with type STYP_DEBUG. */
84 #define STYP_DEBUG 0x2000
85
86 /* Specifies a type check section. A section of this type contains parameter
87 argument type check strings used by the AIX binder. */
88 #define STYP_TYPCHK 0x4000
89
90 /* XCOFF handles line number or relocation overflow by creating
91 another section header with STYP_OVRFLO set. */
92 #define STYP_OVRFLO 0x8000
93
94 #define RS6K_AOUTHDR_OMAGIC 0x0107 /* old: text & data writeable */
95 #define RS6K_AOUTHDR_NMAGIC 0x0108 /* new: text r/o, data r/w */
96 #define RS6K_AOUTHDR_ZMAGIC 0x010B /* paged: text r/o, both page-aligned */
97
98 /* Flags for aouthdr o_flags */
99 #define RS6K_AOUTHDR_TLS_LE 0x80 /* TLS local-exec code was generated */
100 #define RS6K_AOUTHDR_RAS 0x40 /* kernel module is key & recovery safe */
101 #define RS6K_AOUTHDR_ALGNTDATA 0xf /* TLS alignment */
102
103 /* Flags for aouthdr o_x64flags */
104 #define RS6K_AOUTHDR_SHR_SYMTAB 0x8000
105 #define RS6K_AOUTHDR_FORK_POLICY 0x4000
106 #define RS6K_AOUTHDR_FORK_COR 0x2000
107
108
109 /* XCOFF relocation types.
110 The relocations are described in the function
111 xcoff[64]_ppc_relocate_section in coff64-rs6000.c and coff-rs6000.c */
112
113 #define R_POS (0x00)
114 #define R_NEG (0x01)
115 #define R_REL (0x02)
116 #define R_TOC (0x03)
117 #define R_TRL (0x04)
118 #define R_GL (0x05)
119 #define R_TCL (0x06)
120 #define R_BA (0x08)
121 #define R_BR (0x0a)
122 #define R_RL (0x0c)
123 #define R_RLA (0x0d)
124 #define R_REF (0x0f)
125 #define R_TRLA (0x13)
126 #define R_RRTBI (0x14)
127 #define R_RRTBA (0x15)
128 #define R_CAI (0x16)
129 #define R_CREL (0x17)
130 #define R_RBA (0x18)
131 #define R_RBAC (0x19)
132 #define R_RBR (0x1a)
133 #define R_RBRC (0x1b)
134 #define R_TLS (0x20)
135 #define R_TLS_IE (0x21)
136 #define R_TLS_LD (0x22)
137 #define R_TLS_LE (0x23)
138 #define R_TLSM (0x24)
139 #define R_TLSML (0x25)
140 #define R_TOCU (0x30)
141 #define R_TOCL (0x31)
142
143 /* Storage class #defines, from /usr/include/storclass.h that are not already
144 defined in internal.h */
145
146 /* Comment string in .info section */
147 #define C_INFO 110
148
149 /* Dwarf symbol. */
150 #define C_DWARF 112
151
152 /* Auxillary Symbol Entries */
153
154 /* x_smtyp values: */
155 #define SMTYP_ALIGN(x) ((x) >> 3) /* log2 of alignment */
156 #define SMTYP_SMTYP(x) ((x) & 0x7) /* symbol type */
157 /* Symbol type values: */
158 #define XTY_ER 0 /* External reference */
159 #define XTY_SD 1 /* Csect definition */
160 #define XTY_LD 2 /* Label definition */
161 #define XTY_CM 3 /* .BSS */
162 #define XTY_EM 4 /* Error message */
163 #define XTY_US 5 /* "Reserved for internal use" */
164
165 /* x_smclas values: */
166 #define XMC_PR 0 /* Read-only program code */
167 #define XMC_RO 1 /* Read-only constant */
168 #define XMC_DB 2 /* Read-only debug dictionary table */
169 #define XMC_TC 3 /* Read-write general TOC entry */
170 #define XMC_UA 4 /* Read-write unclassified */
171 #define XMC_RW 5 /* Read-write data */
172 #define XMC_GL 6 /* Read-only global linkage */
173 #define XMC_XO 7 /* Read-only extended operation */
174 #define XMC_SV 8 /* Read-only supervisor call */
175 #define XMC_BS 9 /* Read-write BSS */
176 #define XMC_DS 10 /* Read-write descriptor csect */
177 #define XMC_UC 11 /* Read-write unnamed Fortran common */
178 #define XMC_TI 12 /* Read-only traceback index csect */
179 #define XMC_TB 13 /* Read-only traceback table csect */
180 /* 14 ??? */
181 #define XMC_TC0 15 /* Read-write TOC anchor */
182 #define XMC_TD 16 /* Read-write data in TOC */
183 #define XMC_SV64 17 /* Read-only 64 bit supervisor call */
184 #define XMC_SV3264 18 /* Read-only 32 or 64 bit supervisor call */
185 /* 19 ??? */
186 #define XMC_TL 20 /* Read-write initialized TLS data */
187 #define XMC_UL 21 /* Read-write uninitialized TLS data */
188 #define XMC_TE 22 /* Same as XMC_TC but mapped after it */
189
190 /* The ldhdr structure. This appears at the start of the .loader
191 section. */
192
193 struct internal_ldhdr
194 {
195 /* The version number:
196 1 : 32 bit
197 2 : 64 bit */
198 unsigned long l_version;
199
200 /* The number of symbol table entries. */
201 bfd_size_type l_nsyms;
202
203 /* The number of relocation table entries. */
204 bfd_size_type l_nreloc;
205
206 /* The length of the import file string table. */
207 bfd_size_type l_istlen;
208
209 /* The number of import files. */
210 bfd_size_type l_nimpid;
211
212 /* The offset from the start of the .loader section to the first
213 entry in the import file table. */
214 bfd_size_type l_impoff;
215
216 /* The length of the string table. */
217 bfd_size_type l_stlen;
218
219 /* The offset from the start of the .loader section to the first
220 entry in the string table. */
221 bfd_size_type l_stoff;
222
223 /* The offset to start of the symbol table, only in XCOFF64 */
224 bfd_vma l_symoff;
225
226 /* The offset to the start of the relocation table, only in XCOFF64 */
227 bfd_vma l_rldoff;
228 };
229
230 /* The ldsym structure. This is used to represent a symbol in the
231 .loader section. */
232
233 struct internal_ldsym
234 {
235 union
236 {
237 /* The symbol name if <= SYMNMLEN characters. */
238 char _l_name[SYMNMLEN];
239 struct
240 {
241 /* Zero if the symbol name is more than SYMNMLEN characters. */
242 long _l_zeroes;
243
244 /* The offset in the string table if the symbol name is more
245 than SYMNMLEN characters. */
246 long _l_offset;
247 }
248 _l_l;
249 }
250 _l;
251
252 /* The symbol value. */
253 bfd_vma l_value;
254
255 /* The symbol section number. */
256 short l_scnum;
257
258 /* The symbol type and flags. */
259 char l_smtype;
260
261 /* The symbol storage class. */
262 char l_smclas;
263
264 /* The import file ID. */
265 bfd_size_type l_ifile;
266
267 /* Offset to the parameter type check string. */
268 bfd_size_type l_parm;
269 };
270
271 /* These flags are for the l_smtype field (the lower three bits are an
272 XTY_* value). */
273
274 /* Imported symbol. */
275 #define L_IMPORT (0x40)
276 /* Entry point. */
277 #define L_ENTRY (0x20)
278 /* Exported symbol. */
279 #define L_EXPORT (0x10)
280 /* Weak symbol. */
281 #define L_WEAK (0x08)
282
283 /* The ldrel structure. This is used to represent a reloc in the
284 .loader section. */
285
286 struct internal_ldrel
287 {
288 /* The reloc address. */
289 bfd_vma l_vaddr;
290
291 /* The symbol table index in the .loader section symbol table. */
292 bfd_size_type l_symndx;
293
294 /* The relocation type and size. */
295 short l_rtype;
296
297 /* The section number this relocation applies to. */
298 short l_rsecnm;
299 };
300
301 /* An entry in the XCOFF linker hash table. */
302 struct xcoff_link_hash_entry
303 {
304 struct bfd_link_hash_entry root;
305
306 /* Symbol index in output file. Set to -1 initially. Set to -2 if
307 there is a reloc against this symbol. */
308 long indx;
309
310 /* If we have created a TOC entry for this symbol, this is the .tc
311 section which holds it. */
312 asection *toc_section;
313
314 union
315 {
316 /* If we have created a TOC entry (the XCOFF_SET_TOC flag is
317 set), this is the offset in toc_section. */
318 bfd_vma toc_offset;
319
320 /* If the TOC entry comes from an input file, this is set to the
321 symbol index of the C_HIDEXT XMC_TC or XMC_TD symbol. */
322 long toc_indx;
323 }
324 u;
325
326 /* If this symbol is a function entry point which is called, this
327 field holds a pointer to the function descriptor. If this symbol
328 is a function descriptor, this field holds a pointer to the
329 function entry point. */
330 struct xcoff_link_hash_entry *descriptor;
331
332 /* The .loader symbol table entry, if there is one. */
333 struct internal_ldsym *ldsym;
334
335 /* If XCOFF_BUILT_LDSYM is set, this is the .loader symbol table
336 index. If XCOFF_BUILD_LDSYM is clear, and XCOFF_IMPORT is set,
337 this is the l_ifile value. */
338 long ldindx;
339
340 /* Some linker flags. */
341 unsigned long flags;
342
343 /* The storage mapping class. */
344 unsigned char smclas;
345 };
346
347 /* Flags for xcoff_link_hash_entry. */
348
349 /* Symbol is referenced by a regular object. */
350 #define XCOFF_REF_REGULAR 0x00000001
351 /* Symbol is defined by a regular object. */
352 #define XCOFF_DEF_REGULAR 0x00000002
353 /* Symbol is defined by a dynamic object. */
354 #define XCOFF_DEF_DYNAMIC 0x00000004
355 /* Symbol is used in a reloc being copied into the .loader section. */
356 #define XCOFF_LDREL 0x00000008
357 /* Symbol is the entry point. */
358 #define XCOFF_ENTRY 0x00000010
359 /* Symbol is for a function and is the target of a relocation.
360 The relocation may or may not be a branch-type relocation. */
361 #define XCOFF_CALLED 0x00000020
362 /* Symbol needs the TOC entry filled in. */
363 #define XCOFF_SET_TOC 0x00000040
364 /* Symbol is implicitly or explicitly imported. */
365 #define XCOFF_IMPORT 0x00000080
366 /* Symbol is explicitly exported. */
367 #define XCOFF_EXPORT 0x00000100
368 /* Symbol has been processed by xcoff_build_ldsyms. */
369 #define XCOFF_BUILT_LDSYM 0x00000200
370 /* Symbol is mentioned by a section which was not garbage collected. */
371 #define XCOFF_MARK 0x00000400
372 /* Symbol size is recorded in size_list list from hash table. */
373 #define XCOFF_HAS_SIZE 0x00000800
374 /* Symbol is a function descriptor. */
375 #define XCOFF_DESCRIPTOR 0x00001000
376 /* Multiple definitions have been for the symbol. */
377 #define XCOFF_MULTIPLY_DEFINED 0x00002000
378 /* Symbol is the __rtinit symbol. */
379 #define XCOFF_RTINIT 0x00004000
380 /* Symbol is an imported 32 bit syscall. */
381 #define XCOFF_SYSCALL32 0x00008000
382 /* Symbol is an imported 64 bit syscall. */
383 #define XCOFF_SYSCALL64 0x00010000
384 /* Symbol was not explicitly defined by the time it was marked. */
385 #define XCOFF_WAS_UNDEFINED 0x00020000
386 /* We have assigned an output XCOFF entry to this symbol. */
387 #define XCOFF_ALLOCATED 0x00040000
388
389 /* The XCOFF linker hash table. */
390
391 #define XCOFF_NUMBER_OF_SPECIAL_SECTIONS 6
392 #define XCOFF_SPECIAL_SECTION_TEXT 0
393 #define XCOFF_SPECIAL_SECTION_ETEXT 1
394 #define XCOFF_SPECIAL_SECTION_DATA 2
395 #define XCOFF_SPECIAL_SECTION_EDATA 3
396 #define XCOFF_SPECIAL_SECTION_END 4
397 #define XCOFF_SPECIAL_SECTION_END2 5
398
399 /* These flags indicate which of -bexpall and -bexpfull are in effect. */
400 #define XCOFF_EXPALL 1
401 #define XCOFF_EXPFULL 2
402
403 /* This structure is used to pass information through
404 xcoff_link_hash_traverse. */
405
406 struct xcoff_loader_info
407 {
408 /* Set if a problem occurred. */
409 bfd_boolean failed;
410
411 /* Output BFD. */
412 bfd *output_bfd;
413
414 /* Link information structure. */
415 struct bfd_link_info *info;
416
417 /* A mask of XCOFF_EXPALL and XCOFF_EXPFULL flags. */
418 unsigned int auto_export_flags;
419
420 /* Number of ldsym structures. */
421 size_t ldsym_count;
422
423 /* Size of string table. */
424 size_t string_size;
425
426 /* String table. */
427 char *strings;
428
429 /* Allocated size of string table. */
430 size_t string_alc;
431 };
432
433 /* In case we're on a 32-bit machine, construct a 64-bit "-1" value
434 from smaller values. Start with zero, widen, *then* decrement. */
435 #define MINUS_ONE (((bfd_vma) 0) - 1)
436
437 /* __rtinit, from /usr/include/rtinit.h. */
438 struct __rtinit
439 {
440 /* Pointer to runtime linker.
441 XXX: Is the parameter really void? */
442 int (*rtl) (void);
443
444 /* Offset to array of init functions, 0 if none. */
445 int init_offset;
446
447 /* Offset to array of fini functions, 0 if none. */
448 int fini_offset;
449
450 /* Size of __RTINIT_DESCRIPTOR. This value should be used instead of
451 sizeof(__RTINIT_DESCRIPTOR). */
452 int __rtinit_descriptor_size;
453 };
454
455 #define RTINIT_DESCRIPTOR_SIZE (12)
456
457 struct __rtinit_descriptor
458 {
459 /* Init/fini function. */
460 int f;
461
462 /* Offset, relative to the start of the __rtinit symbol, to name of the
463 function. */
464
465 int name_offset;
466
467 /* Flags */
468 unsigned char flags;
469 };
470
471 /* Archive */
472
473 #define XCOFFARMAG "<aiaff>\012"
474 #define XCOFFARMAGBIG "<bigaf>\012"
475 #define SXCOFFARMAG 8
476
477 /* The size of the ascii archive elements */
478 #define XCOFFARMAG_ELEMENT_SIZE 12
479 #define XCOFFARMAGBIG_ELEMENT_SIZE 20
480
481 /* This terminates an XCOFF archive member name. */
482
483 #define XCOFFARFMAG "`\012"
484 #define SXCOFFARFMAG 2
485
486 /* XCOFF archives start with this (printable) structure. */
487
488 struct xcoff_ar_file_hdr
489 {
490 /* Magic string. */
491 char magic[SXCOFFARMAG];
492
493 /* Offset of the member table (decimal ASCII string). */
494 char memoff[XCOFFARMAG_ELEMENT_SIZE];
495
496 /* Offset of the global symbol table (decimal ASCII string). */
497 char symoff[XCOFFARMAG_ELEMENT_SIZE];
498
499 /* Offset of the first member in the archive (decimal ASCII string). */
500 char firstmemoff[XCOFFARMAG_ELEMENT_SIZE];
501
502 /* Offset of the last member in the archive (decimal ASCII string). */
503 char lastmemoff[XCOFFARMAG_ELEMENT_SIZE];
504
505 /* Offset of the first member on the free list (decimal ASCII
506 string). */
507 char freeoff[XCOFFARMAG_ELEMENT_SIZE];
508 };
509
510 #define SIZEOF_AR_FILE_HDR (SXCOFFARMAG + 5 * XCOFFARMAG_ELEMENT_SIZE)
511
512 /* This is the equivalent data structure for the big archive format. */
513
514 struct xcoff_ar_file_hdr_big
515 {
516 /* Magic string. */
517 char magic[SXCOFFARMAG];
518
519 /* Offset of the member table (decimal ASCII string). */
520 char memoff[XCOFFARMAGBIG_ELEMENT_SIZE];
521
522 /* Offset of the global symbol table for 32-bit objects (decimal ASCII
523 string). */
524 char symoff[XCOFFARMAGBIG_ELEMENT_SIZE];
525
526 /* Offset of the global symbol table for 64-bit objects (decimal ASCII
527 string). */
528 char symoff64[XCOFFARMAGBIG_ELEMENT_SIZE];
529
530 /* Offset of the first member in the archive (decimal ASCII string). */
531 char firstmemoff[XCOFFARMAGBIG_ELEMENT_SIZE];
532
533 /* Offset of the last member in the archive (decimal ASCII string). */
534 char lastmemoff[XCOFFARMAGBIG_ELEMENT_SIZE];
535
536 /* Offset of the first member on the free list (decimal ASCII
537 string). */
538 char freeoff[XCOFFARMAGBIG_ELEMENT_SIZE];
539 };
540
541 #define SIZEOF_AR_FILE_HDR_BIG (SXCOFFARMAG + 6 * XCOFFARMAGBIG_ELEMENT_SIZE)
542
543 /* Each XCOFF archive member starts with this (printable) structure. */
544
545 struct xcoff_ar_hdr
546 {
547 /* File size not including the header (decimal ASCII string). */
548 char size[XCOFFARMAG_ELEMENT_SIZE];
549
550 /* File offset of next archive member (decimal ASCII string). */
551 char nextoff[XCOFFARMAG_ELEMENT_SIZE];
552
553 /* File offset of previous archive member (decimal ASCII string). */
554 char prevoff[XCOFFARMAG_ELEMENT_SIZE];
555
556 /* File mtime (decimal ASCII string). */
557 char date[12];
558
559 /* File UID (decimal ASCII string). */
560 char uid[12];
561
562 /* File GID (decimal ASCII string). */
563 char gid[12];
564
565 /* File mode (octal ASCII string). */
566 char mode[12];
567
568 /* Length of file name (decimal ASCII string). */
569 char namlen[4];
570
571 /* This structure is followed by the file name. The length of the
572 name is given in the namlen field. If the length of the name is
573 odd, the name is followed by a null byte. The name and optional
574 null byte are followed by XCOFFARFMAG, which is not included in
575 namlen. The contents of the archive member follow; the number of
576 bytes is given in the size field. */
577 };
578
579 #define SIZEOF_AR_HDR (3 * XCOFFARMAG_ELEMENT_SIZE + 4 * 12 + 4)
580
581 /* The equivalent for the big archive format. */
582
583 struct xcoff_ar_hdr_big
584 {
585 /* File size not including the header (decimal ASCII string). */
586 char size[XCOFFARMAGBIG_ELEMENT_SIZE];
587
588 /* File offset of next archive member (decimal ASCII string). */
589 char nextoff[XCOFFARMAGBIG_ELEMENT_SIZE];
590
591 /* File offset of previous archive member (decimal ASCII string). */
592 char prevoff[XCOFFARMAGBIG_ELEMENT_SIZE];
593
594 /* File mtime (decimal ASCII string). */
595 char date[12];
596
597 /* File UID (decimal ASCII string). */
598 char uid[12];
599
600 /* File GID (decimal ASCII string). */
601 char gid[12];
602
603 /* File mode (octal ASCII string). */
604 char mode[12];
605
606 /* Length of file name (decimal ASCII string). */
607 char namlen[4];
608
609 /* This structure is followed by the file name. The length of the
610 name is given in the namlen field. If the length of the name is
611 odd, the name is followed by a null byte. The name and optional
612 null byte are followed by XCOFFARFMAG, which is not included in
613 namlen. The contents of the archive member follow; the number of
614 bytes is given in the size field. */
615 };
616
617 #define SIZEOF_AR_HDR_BIG (3 * XCOFFARMAGBIG_ELEMENT_SIZE + 4 * 12 + 4)
618
619 /* We often have to distinguish between the old and big file format.
620 Make it a bit cleaner. We can use `xcoff_ardata' here because the
621 `hdr' member has the same size and position in both formats.
622 <bigaf> is the default format, return TRUE even when xcoff_ardata is
623 NULL. */
624 #ifndef SMALL_ARCHIVE
625 /* Creates big archives by default */
626 #define xcoff_big_format_p(abfd) \
627 ((NULL != bfd_ardata (abfd) && NULL == xcoff_ardata (abfd)) || \
628 ((NULL != bfd_ardata (abfd)) && \
629 (NULL != xcoff_ardata (abfd)) && \
630 (xcoff_ardata (abfd)->magic[1] == 'b')))
631 #else
632 /* Creates small archives by default. */
633 #define xcoff_big_format_p(abfd) \
634 (((NULL != bfd_ardata (abfd)) && \
635 (NULL != xcoff_ardata (abfd)) && \
636 (xcoff_ardata (abfd)->magic[1] == 'b')))
637 #endif
638
639 /* We store a copy of the xcoff_ar_file_hdr in the tdata field of the
640 artdata structure. Similar for the big archive. */
641 #define xcoff_ardata(abfd) \
642 ((struct xcoff_ar_file_hdr *) bfd_ardata (abfd)->tdata)
643 #define xcoff_ardata_big(abfd) \
644 ((struct xcoff_ar_file_hdr_big *) bfd_ardata (abfd)->tdata)
645
646 /* We store a copy of the xcoff_ar_hdr in the arelt_data field of an
647 archive element. Similar for the big archive. */
648 #define arch_eltdata(bfd) ((struct areltdata *) ((bfd)->arelt_data))
649 #define arch_xhdr(bfd) \
650 ((struct xcoff_ar_hdr *) arch_eltdata (bfd)->arch_header)
651 #define arch_xhdr_big(bfd) \
652 ((struct xcoff_ar_hdr_big *) arch_eltdata (bfd)->arch_header)
653
654 /* True if symbols of class CLASS are external. */
655 #define EXTERN_SYM_P(CLASS) \
656 ((CLASS) == C_EXT || (CLASS) == C_AIX_WEAKEXT)
657
658 #endif /* _INTERNAL_XCOFF_H */