{"push_id":1202968469,"size":2,"distinct_size":2,"ref":"refs/heads/master","head":"d3e5f6c8f1e58e86689909019a3756d4308b66eb","before":"7df94786e4723ba93d8982e55fc5e652b4b80142","commits":[{"sha":"e511c9b19faec4d21aef49d12224316dea3d51eb","author":{"name":"Andrew Burgess","email":"8dfdcc0b71f832e57b0f66b1419843d071d9fad8@embecosm.com"},"message":"objcopy/strip: Allow section patterns starting with '!'.\n\nFor symbol matching, prefixing a pattern with '!' will indicate a\nnon-matching pattern, however, this is not the case for section\npatterns.  As a result it is not possible to say \"apply this action to\nall sections except ...\".\n\nWith this commit the objcopy and strip tools now support '!' prefix for\nsection patterns, so we can say:\n\n  objcopy --remove-section=\"*\" --remove-section=\"!.text*\"\n\nWhich will remove all sections, except those matching the pattern\n'.text*'.\n\nbinutils/ChangeLog:\n\n\t* objcopy.c (find_section_list): Handle section patterns starting\n\twith '!' being a non-matching pattern.\n\t* doc/binutils.texi (objcopy): Give example of using '!' with\n\t--remove-section and --only-section.\n\t(strip): Give example of using '!' with --remove-section.\n\t* testsuite/binutils-all/data-sections.s: New file.\n\t* testsuite/binutils-all/only-section-01.d: New file.\n\t* testsuite/binutils-all/remove-section-01.d: New file.\n\t* testsuite/binutils-all/objcopy.exp: Run new tests.\n\t* NEWS: Mention new feature.","distinct":true,"url":"https://api.github.com/repos/wallento/binutils-gdb/commits/e511c9b19faec4d21aef49d12224316dea3d51eb"},{"sha":"d3e5f6c8f1e58e86689909019a3756d4308b66eb","author":{"name":"Andrew Burgess","email":"8dfdcc0b71f832e57b0f66b1419843d071d9fad8@embecosm.com"},"message":"objcopy/strip: Add option --remove-relocations=SECTIONPATTERN\n\nThe objcopy and strip tools make use of the bfd library to manipulate\nthe state of the input file (to produce an output file).  Within the\ninput file (for ELF at least), relocations are held within a section,\nand so, if the user wanted to remove the relocations, but keep the\nsection to which the relocations would have been applied, it is tempting\nto think that specifying the name of a relocation section to objcopy's\n--remove-section option might do what you want, for example:\n\n   objcopy --remove-section=.rela.text input.elf output.elf\n\nHowever, this does not work.  The reason is that when the input file is\nloaded, relocations are not managed as sections, but are, instead,\nloaded as data associated with the section to which the relocations\nwould be applied.  In our example above the relocations in '.rela.text'\nare held as data on the section '.text' once 'input.elf' is loaded.\n\nOne task that objcopy and strip do is copy the relocations from the\ninput file to the output file if the section is also being copied from\nthe input file to the output file.\n\nThis commit adds a new command line option for objcopy and strip,\n--remove-relocations, which can be used to remove the relocations, while\nkeeping the section that the relocations would have been applied to, for\nexample:\n\n    objcopy --remove-relocations=.text input.elf output.elf\n\nin this case the section '.text' will appear in both 'input.elf' and\n'output.elf', but any relocations in 'input.elf' that apply to '.text'\nwill not be present in 'output.elf'.\n\nI have also added a special case to the handling of --remove-section\nthat spots if a user tries to remove a relocation section (currently\nthis is done by spotting the '.rela.' or '.rel.' prefix) and forwards\nthe request to --remove-relocations.\n\nAs with --remove-section and --only-section the --remove-relocations\noption supports the '!' prefix on the section-patterns it takes to allow\nfor sections to be specifically not matched.\n\nThere are tests for all the new functionality.\n\nbinutils/ChangeLog:\n\n\t* doc/binutils.texi (objcopy): Document 'remove-relocations'.\n\t(strip): Likewise.\n\t* objcopy.c (SECTION_CONTEXT_REMOVE_RELOCS): Define.\n\t(enum command_line_switch): Add 'OPTION_REMOVE_RELOCS'.\n\t(struct option strip_options): Add 'remove-relocations'.\n\t(struct option copy_options): Likewise.\n\t(copy_usage): Likewise.\n\t(strip_usage): Likewise.\n\t(handle_remove_relocations_option): New function.\n\t(discard_relocations): New function.\n\t(handle_remove_section_option): New function.\n\t(copy_relocations_in_section): Use discard_relocations.\n\t(strip_main): Use handle_remove_section_option for\n\t'remove-section', and handle 'remove-relocations' option.\n\t(copy_main): Likewise.\n\t* testsuite/binutils-all/objcopy.exp: Run new tests.\n\t* testsuite/binutils-all/remove-relocs-01.d: New file.\n\t* testsuite/binutils-all/remove-relocs-01.s: New file.\n\t* testsuite/binutils-all/remove-relocs-02.d: New file.\n\t* testsuite/binutils-all/remove-relocs-03.d: New file.\n\t* testsuite/binutils-all/remove-relocs-04.d: New file.\n\t* testsuite/binutils-all/remove-relocs-05.d: New file.\n\t* testsuite/binutils-all/remove-relocs-06.d: New file.","distinct":true,"url":"https://api.github.com/repos/wallento/binutils-gdb/commits/d3e5f6c8f1e58e86689909019a3756d4308b66eb"}]}
{"actor":{"display_login":"wallento"}}