This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

.{init,fini,preinit}_array in RW segment??


Hi!

In the builtin linker script, these sections are located in RW segment
even for binaries.
...
  /* Adjust the address for the data segment.  We want to adjust up to
     the same address within the page on the next page up.  */
  ${CREATE_SHLIB-${RELOCATING+. = ${DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
  ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}

  /* Ensure the __preinit_array_start label is properly aligned.  We
     could instead move the label definition inside the section, but
     the linker would then create the section even if it turns out to
     be empty, which isn't pretty.  */
  ${RELOCATING+. = ALIGN(${ALIGNMENT});}
  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_start = .);}}
  .preinit_array   ${RELOCATING-0} : { *(.preinit_array) }
  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_end = .);}}

  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__init_array_start = .);}}
  .init_array   ${RELOCATING-0} : { *(.init_array) }
  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__init_array_end = .);}}

  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_start = .);}}
  .fini_array   ${RELOCATING-0} : { *(.fini_array) }
  ${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_end = .);}}
...

Shouldn't they be in the RO segment for binaries?

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]