+ // Saw DATA_SEGMENT_ALIGN.
+ void
+ data_segment_align();
+
+ // Saw DATA_SEGMENT_RELRO_END.
+ void
+ data_segment_relro_end();
+
+ // Create any required sections.
+ void
+ create_sections(Layout*);
+
+ // Add any symbols we are defining to the symbol table.
+ void
+ add_symbols_to_table(Symbol_table*);
+
+ // Finalize symbol values and check assertions.
+ void
+ finalize_symbols(Symbol_table* symtab, const Layout* layout);
+
+ // Find the name of the output section to use for an input file name
+ // and section name. This returns a name, and sets
+ // *OUTPUT_SECTION_SLOT to point to the address where the actual
+ // output section may be stored.
+ // 1) If the input section should be discarded, this returns NULL
+ // and sets *OUTPUT_SECTION_SLOT to NULL.
+ // 2) If the input section is mapped by the SECTIONS clause, this
+ // returns the name to use for the output section (in permanent
+ // storage), and sets *OUTPUT_SECTION_SLOT to point to where the
+ // output section should be stored. **OUTPUT_SECTION_SLOT will be
+ // non-NULL if we have seen this output section already.
+ // 3) If the input section is not mapped by the SECTIONS clause,
+ // this returns SECTION_NAME, and sets *OUTPUT_SECTION_SLOT to
+ // NULL.
+ // PSCRIPT_SECTION_TYPE points to a location for returning the section
+ // type specified in script. This can be SCRIPT_SECTION_TYPE_NONE if
+ // no type is specified.
+ // *KEEP indicates whether the section should survive garbage collection.
+ const char*
+ output_section_name(const char* file_name, const char* section_name,
+ Output_section*** output_section_slot,
+ Section_type* pscript_section_type,
+ bool* keep);
+
+ // Place a marker for an orphan output section into the SECTIONS
+ // clause.
+ void
+ place_orphan(Output_section* os);
+
+ // Set the addresses of all the output sections. Return the segment
+ // which holds the file header and segment headers, if any.
+ Output_segment*
+ set_section_addresses(Symbol_table*, Layout*);
+
+ // Add a program header definition.
+ void
+ add_phdr(const char* name, size_t namelen, unsigned int type,
+ bool filehdr, bool phdrs, bool is_flags_valid, unsigned int flags,
+ Expression* load_address);
+
+ // Return the number of segments we expect to create based on the
+ // SECTIONS clause.
+ size_t
+ expected_segment_count(const Layout*) const;
+
+ // Add the file header and segment header to non-load segments as
+ // specified by the PHDRS clause.
+ void
+ put_headers_in_phdrs(Output_data* file_header, Output_data* segment_headers);
+
+ // Look for an output section by name and return the address, the
+ // load address, the alignment, and the size. This is used when an
+ // expression refers to an output section which was not actually
+ // created. This returns true if the section was found, false
+ // otherwise.
+ bool
+ get_output_section_info(const char* name, uint64_t* address,
+ uint64_t* load_address, uint64_t* addralign,
+ uint64_t* size) const;
+
+ // Release all Output_segments. This is used in relaxation.
+ void
+ release_segments();
+
+ // Whether we ever saw a SEGMENT_START expression, the presence of which
+ // changes the behaviour of -Ttext, -Tdata and -Tbss options.
+ bool
+ saw_segment_start_expression() const
+ { return this->saw_segment_start_expression_; }
+
+ // Set the flag which indicates whether we saw a SEGMENT_START expression.
+ void
+ set_saw_segment_start_expression(bool value)
+ { this->saw_segment_start_expression_ = value; }
+
+ // Add a memory region.
+ void
+ add_memory_region(const char*, size_t, unsigned int,
+ Expression*, Expression*);
+
+ // Find a memory region's origin.
+ Expression*
+ find_memory_region_origin(const char*, size_t);
+
+ // Find a memory region's length.
+ Expression*
+ find_memory_region_length(const char*, size_t);
+
+ // Find a memory region by name.
+ Memory_region*
+ find_memory_region(const char*, size_t);
+
+ // Find a memory region that should be used by a given output section.
+ Memory_region*
+ find_memory_region(Output_section_definition*, bool,
+ Output_section_definition**);
+
+ // Returns true if the provide block of memory is contained
+ // within a memory region.
+ bool
+ block_in_region(Symbol_table*, Layout*, uint64_t, uint64_t) const;
+
+ // Set the memory region of the section.
+ void
+ set_memory_region(Memory_region*, bool);
+