This is the mail archive of the
mailing list for the binutils project.
Re: Plugin interfaces to do Pettis Hansen style code layout in the gold linker.
Sriraman Tallam <firstname.lastname@example.org> writes:
> Made the changes and attached the new patch. Please also see function
> get_view in plugin.cc. I made the following change to correct the
> detection of whether get_view if called from the claim_file_hook.
> - if (this->objects_.size() == handle)
> + if (this->in_claim_file_handler_)
> // We are being called from the claim_file hook.
> + const std::string section_name = obj->section_name(section.shndx);
> + const char* section_name_c_ptr = section_name.c_str();
> + *section_name_ptr
> + = static_cast<char*>(malloc(strlen(section_name_c_ptr) + 1));
> + strcpy(*section_name_ptr, section_name_c_ptr);
> + return LDPS_OK;
Change to something like
const std::string section_name = obj->section_name(section.shndx);
*section_name_ptr = static_cast<char*>(malloc(section_name.length() + 1));
section_name.length() + 1);
This is OK with that change.
Thanks, and thanks for your patience with this.