| OLD | NEW |
| 1 // layout.h -- lay out output file sections for gold -*- C++ -*- | 1 // layout.h -- lay out output file sections for gold -*- C++ -*- |
| 2 | 2 |
| 3 // Copyright 2006, 2007, 2008, 2009 Free Software Foundation, Inc. | 3 // Copyright 2006, 2007, 2008, 2009 Free Software Foundation, Inc. |
| 4 // Written by Ian Lance Taylor <iant@google.com>. | 4 // Written by Ian Lance Taylor <iant@google.com>. |
| 5 | 5 |
| 6 // This file is part of gold. | 6 // This file is part of gold. |
| 7 | 7 |
| 8 // This program is free software; you can redistribute it and/or modify | 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 | 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 | 10 // the Free Software Foundation; either version 3 of the License, or |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 off_t* offset); | 353 off_t* offset); |
| 354 | 354 |
| 355 // Handle a GNU stack note. This is called once per input object | 355 // Handle a GNU stack note. This is called once per input object |
| 356 // file. SEEN_GNU_STACK is true if the object file has a | 356 // file. SEEN_GNU_STACK is true if the object file has a |
| 357 // .note.GNU-stack section. GNU_STACK_FLAGS is the section flags | 357 // .note.GNU-stack section. GNU_STACK_FLAGS is the section flags |
| 358 // from that section if there was one. | 358 // from that section if there was one. |
| 359 void | 359 void |
| 360 layout_gnu_stack(bool seen_gnu_stack, uint64_t gnu_stack_flags); | 360 layout_gnu_stack(bool seen_gnu_stack, uint64_t gnu_stack_flags); |
| 361 | 361 |
| 362 // Add an Output_section_data to the layout. This is used for | 362 // Add an Output_section_data to the layout. This is used for |
| 363 // special sections like the GOT section. | 363 // special sections like the GOT section. IS_DYNAMIC_LINKER_SECTION |
| 364 // is true for sections which are used by the dynamic linker, such |
| 365 // as dynamic reloc sections. |
| 364 Output_section* | 366 Output_section* |
| 365 add_output_section_data(const char* name, elfcpp::Elf_Word type, | 367 add_output_section_data(const char* name, elfcpp::Elf_Word type, |
| 366 elfcpp::Elf_Xword flags, | 368 elfcpp::Elf_Xword flags, |
| 367 » » » Output_section_data*); | 369 » » » Output_section_data*, bool is_dynamic_linker_section); |
| 368 | 370 |
| 369 // Create dynamic sections if necessary. | 371 // Create dynamic sections if necessary. |
| 370 void | 372 void |
| 371 create_initial_dynamic_sections(Symbol_table*); | 373 create_initial_dynamic_sections(Symbol_table*); |
| 372 | 374 |
| 373 // Define __start and __stop symbols for output sections. | 375 // Define __start and __stop symbols for output sections. |
| 374 void | 376 void |
| 375 define_section_symbols(Symbol_table*); | 377 define_section_symbols(Symbol_table*); |
| 376 | 378 |
| 377 // Create automatic note sections. | 379 // Create automatic note sections. |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 738 static const char* | 740 static const char* |
| 739 output_section_name(const char* name, size_t* plen); | 741 output_section_name(const char* name, size_t* plen); |
| 740 | 742 |
| 741 // Return the number of allocated output sections. | 743 // Return the number of allocated output sections. |
| 742 size_t | 744 size_t |
| 743 allocated_output_section_count() const; | 745 allocated_output_section_count() const; |
| 744 | 746 |
| 745 // Return the output section for NAME, TYPE and FLAGS. | 747 // Return the output section for NAME, TYPE and FLAGS. |
| 746 Output_section* | 748 Output_section* |
| 747 get_output_section(const char* name, Stringpool::Key name_key, | 749 get_output_section(const char* name, Stringpool::Key name_key, |
| 748 » » elfcpp::Elf_Word type, elfcpp::Elf_Xword flags); | 750 » » elfcpp::Elf_Word type, elfcpp::Elf_Xword flags, |
| 751 » » bool is_interp, bool is_dynamic_linker_section); |
| 749 | 752 |
| 750 // Choose the output section for NAME in RELOBJ. | 753 // Choose the output section for NAME in RELOBJ. |
| 751 Output_section* | 754 Output_section* |
| 752 choose_output_section(const Relobj* relobj, const char* name, | 755 choose_output_section(const Relobj* relobj, const char* name, |
| 753 elfcpp::Elf_Word type, elfcpp::Elf_Xword flags, | 756 elfcpp::Elf_Word type, elfcpp::Elf_Xword flags, |
| 754 » » » bool is_input_section); | 757 » » » bool is_input_section, bool is_interp, |
| 758 » » » bool is_dynamic_linker_section); |
| 755 | 759 |
| 756 // Create a new Output_section. | 760 // Create a new Output_section. |
| 757 Output_section* | 761 Output_section* |
| 758 make_output_section(const char* name, elfcpp::Elf_Word type, | 762 make_output_section(const char* name, elfcpp::Elf_Word type, |
| 759 » » elfcpp::Elf_Xword flags); | 763 » » elfcpp::Elf_Xword flags, bool is_interp, |
| 764 » » bool is_dynamic_linker_section); |
| 760 | 765 |
| 761 // Attach a section to a segment. | 766 // Attach a section to a segment. |
| 762 void | 767 void |
| 763 attach_section_to_segment(Output_section*); | 768 attach_section_to_segment(Output_section*); |
| 764 | 769 |
| 765 // Attach an allocated section to a segment. | 770 // Attach an allocated section to a segment. |
| 766 void | 771 void |
| 767 attach_allocated_section_to_segment(Output_section*); | 772 attach_allocated_section_to_segment(Output_section*); |
| 768 | 773 |
| 769 // Set the final file offsets of all the segments. | 774 // Set the final file offsets of all the segments. |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1170 align_address(uint64_t address, uint64_t addralign) | 1175 align_address(uint64_t address, uint64_t addralign) |
| 1171 { | 1176 { |
| 1172 if (addralign != 0) | 1177 if (addralign != 0) |
| 1173 address = (address + addralign - 1) &~ (addralign - 1); | 1178 address = (address + addralign - 1) &~ (addralign - 1); |
| 1174 return address; | 1179 return address; |
| 1175 } | 1180 } |
| 1176 | 1181 |
| 1177 } // End namespace gold. | 1182 } // End namespace gold. |
| 1178 | 1183 |
| 1179 #endif // !defined(GOLD_LAYOUT_H) | 1184 #endif // !defined(GOLD_LAYOUT_H) |
| OLD | NEW |