[PATCH v1 00/14] Several clean-ups and refactorings before a long patch series on AArch64 build attributes

Matthieu Longo matthieu.longo@arm.com
Thu Feb 27 10:47:25 GMT 2025


This patch series contains clean-ups and refactorings required for a future patch series implementing AArch64 AEABI build attributes.

## Space fixes:
clean-up: fix annoying spaces in binutils/readelf.c
clean-up: fix conflicting symbol with unknown from bfd/elf-bfd.h

## Improve code readability
clean-up bfd/elf-attrs.c: change return type of uleb128_size to unsigned
clean-up readelf: simplify and flatten body of process_attributes
clean-up: move writing of build attributes section into a function
refactoring bfd_linear_search_one_with_gnu_property
refactoring _bfd_elf_get_property
refactoring elf_find_and_remove_property

## Clarifications:
clean-up create_obj_attrs_section: comment about .gnu.attributes VS .gnu.build.attributes

## Configuration reusability:
clean-up aarch64: move the name of the build attributes section into include/elf/aarch64.h

## Prepare object attributes v2 (based on AArch64 AEABI build attributes specifications)
clean-up bfd: rename functions for object attributes v1
clean-up bfd/elf-attrs.c: move specific-code to parse object attributes v1 into a new function

## Fix logic
aarch64: setup_gnu_properties only creates the notes section when none exists


Regression tested on aarch64-unknown-linux-gnu, and no regression found.

Ok for binutils-master ?

Regards,
Matthieu.

Matthieu Longo (14):
  clean-up: fix annoying spaces in bfd/elf-bfd.h
  clean-up: fix annoying spaces in binutils/readelf.c
  clean-up: fix conflicting symbol with unknown from bfd/elf-bfd.h
  clean-up bfd/elf-attrs.c: change return type of uleb128_size to unsigned
  clean-up readelf: simplify and flatten body of process_attributes
  clean-up: move writing of build attributes section into a function
  clean-up create_obj_attrs_section: comment about .gnu.attributes VS .gnu.build.attributes
  clean-up aarch64: move the name of the build attributes section into include/elf/aarch64.h
  clean-up bfd: rename functions for object attributes v1
  clean-up bfd/elf-attrs.c: move specific-code to parse object attributes v1 into a new function
  aarch64: setup_gnu_properties only creates the notes section when none exists
  refactoring bfd_linear_search_one_with_gnu_property
  refactoring _bfd_elf_get_property
  refactoring elf_find_and_remove_property

 bfd/elf-attrs.c       | 401 +++++++++++++++++++++++-------------------
 bfd/elf-bfd.h         |  11 +-
 bfd/elf-properties.c  | 118 +++++++++----
 bfd/elflink.c         |  32 ++--
 bfd/elfnn-aarch64.c   |   2 +-
 bfd/elfxx-aarch64.c   |  85 +++++----
 binutils/readelf.c    | 387 ++++++++++++++++++++--------------------
 gas/write.c           |  20 +--
 include/elf/aarch64.h |   2 +
 9 files changed, 580 insertions(+), 478 deletions(-)

-- 
2.48.1



More information about the Binutils mailing list