{"push_id":2117754938,"size":2,"distinct_size":2,"ref":"refs/heads/master","head":"e3e53eed9c2f1ab82ae4a7683f474b4f6eb162c7","before":"d95639024585ce43e8fe0557ac85e706452e1515","commits":[{"sha":"529fe20eeb0030ea5d653d0ebec433f9e3145874","author":{"name":"Alan Modra","email":"3aed519d178e2cda00510b9335fdf9c9798caeee@gmail.com"},"message":"non_got_ref after adjust_dynamic_relocs\n\nThis patch was aimed at a FIXME in elf32-hppa.c, the ludicrous and\nconfusing fact that non_got_ref after adjust_dynamic_relocs in that\nbackend means precisely the inverse of what it means before\nadjust_dynamic_relocs.  Before, when non_got_ref is set it means there\nare dynamic relocs, after, if non_got_ref is clear it means \"keep\ndynamic relocs\" and later, \"has dynamic relocs\".  There is a reason\nwhy it was done that way..  Some symbols that may have dynamic\nrelocations pre-allocated in check_relocs turn out to not be dynamic,\nand then are not seen by the backend adjust_dynamic_symbols.  We want\nthose symbols to lose their dynamic relocs when non-pic, so it's handy\nthat non_got_ref means the opposite after adjust_dynamic_relocs.  But\nit's really confusing.\n\nMost other targets, like ppc32, don't always set non_got_ref on\nnon-GOT references that have dynamic relocations.  This is because the\nprimary purpose of non_got_ref before adjust_dynamic_relocs is to flag\nsymbols that might need to be copied to .dynbss, and there are\nrelocation types that may require dyn_relocs but clearly cannot have\nsymbols copied into .dynbss, for example, TLS relocations.\n\nWhy do we need a flag after adjust_dynamic_relocs to say \"keep\ndynamic relocations\"?  Well, you can discard most unwanted dyn_relocs\nin the backend adjust_dynamic_relocs, and for those symbols that\naren't seen by the backend adjust_dynamic_relocs, in\nallocate_dynrelocs based on a flag set by adjust_dynamic relocs,\ndynamic_adjusted.  That doesn't solve all our difficulties though.\nrelocate_section needs to know whether a symbol has dyn_relocs, and\nmany targets transfer dyn_relocs to a weakdef if the symbol has one.\nThe transfer means relocate_section can't test dyn_relocs itself and\nthe weakdef field has been overwritten by that time.  So non_got_ref\nis used to flag \"this symbol has dynamic relocations\" for\nrelocate_section.\n\nConfused still?  Well, let's hope the comments I've added help clarify\nthings..  The patch also fixes a case where we might wrongly emit\ndynamic relocations in an executable for common and undefined symbols.\n\n\t* elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Set non_got_ref\n\tto keep dyn_relocs, clear to discard.  Comment.\n\t(allocate_dynrelocs): Always clear non_got_ref when clearing\n\tdyn_relocs in non-pic case.  Invert non_got_ref test.  Also test\n\tdynamic_adjusted and ELF_COMMON_DEF_P.  Move code deleting\n\tdyn_relocs on undefined syms to handle for non-pic too.\n\t(elf32_hppa_relocate_section): Simplify test for non-pic dyn relocs.\n\t* elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Set non_got_ref\n\tto keep dyn_relocs, clear to discard.  Comment.\n\t(allocate_dynrelocs): Always clear non_got_ref when clearing\n\tdyn_relocs in non-pic case.  Invert non_got_ref test.  Also test\n\tdynamic_adjusted and ELF_COMMON_DEF_P.  Move code deleting\n\tdyn_relocs on undefined syms to handle for non-pic too.\n\t(ppc_elf_relocate_section): Simplify test for non-pic dyn relocs.\n\t* elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Discard\n\tdyn_relocs here.  Don't bother setting non_got_ref.  Comment.\n\t(allocate_dynrelocs): Delete special handling of non-pic ELFv2\n\tifuncs.  Move code deleting dyn_relocs on undefined symbols to\n\thandle for non-pic too.  Don't test non_got_ref.  Do test\n\tdynamic_adjusted and ELF_COMMON_DEF_P.","distinct":true,"url":"https://api.github.com/repos/wallento/binutils-gdb/commits/529fe20eeb0030ea5d653d0ebec433f9e3145874"},{"sha":"e3e53eed9c2f1ab82ae4a7683f474b4f6eb162c7","author":{"name":"Alan Modra","email":"3aed519d178e2cda00510b9335fdf9c9798caeee@gmail.com"},"message":"weakdef list handling\n\nThe existing code allowed common and indirect symbols to pass an\nassert, but then read root.u.def which is not valid for anything\nbesides defined and weakdef symbols.  The garbage root.u.def.section\npointer read can't possibly match pointers stored at the same location\nfor indirect and common symbols, so we would always have left\nu.weakdef NULL.\n\n\t* elflink.c (elf_link_add_object_symbols): Ignore anything but\n\tdefined and defweak symbols when setting up weakdefs.","distinct":true,"url":"https://api.github.com/repos/wallento/binutils-gdb/commits/e3e53eed9c2f1ab82ae4a7683f474b4f6eb162c7"}]}
{"actor":{"display_login":"wallento"}}