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]

Re: patch : aix ppc partial link fix


On Fri, Aug 03, 2001 at 03:21:38PM -0500, Tom Rix wrote:
> +   *relocation = val + addend;
> +   *relocation -= (input_section->output_section->vma + 
> + 		  input_section->output_offset);

Formatting.  Break a line before an operator.

> +   *relocation = ((val - xcoff_data (output_bfd)->toc) - 
> + 		 (sym->n_value - xcoff_data (input_bfd)->toc));

Again.

> +   if (NULL != h &&
> +       bfd_link_hash_defined == h->root.type &&
> +       (rel->r_vaddr - input_section->vma + 8 <= input_section->_cooked_size)) {

Again.  Put brace on next line too.

> +       if (h->smclas == XMC_GL || 
> + 	  strcmp (h->root.root.string, "._ptrgl") == 0)	{

Similarly.
> + 	if (next == 0x4def7b82 ||	/* cror 15,15,15 */
> + 	    next == 0x4ffffb82 ||	/* cror 31,31,31 */
> + 	    next == 0x60000000)	        /* ori r0,r0,0 */
> + 	    bfd_put_32 (input_bfd, 0x80410014, pnext); /* lwz r1,20(r1) */

Trailing operators.  Also best for readability to separate the body of
an `if' from a multi-line condition with braces.

> +       } else {

Braces and `else' on separate lines.

> +     } else if (NULL != h && bfd_link_hash_undefined == h->root.type) {

Again, put braces on separate lines. `else if' is OK on one line.

> + 	 overflow checking. */

Two spaces after period.

> +   *relocation -= (input_section->output_section->vma + 
> + 		  input_section->output_offset);

Trailing operator.

> +   *relocation -= (input_section->output_section->vma + 
> + 		  input_section->output_offset);

Again.

> + static boolean (*calc_relocation[RS6000_MAX_RELOC_TYPE])
> +      (bfd *input_bfd, asection *input_section, bfd *output_bfd, 
> +       struct internal_reloc *rel, struct internal_syment *sym,
> +       struct reloc_howto_struct *howto, bfd_vma val, bfd_vma addend,
> +       bfd_vma *relocation, bfd_byte *contents) = {

This is one place where the brace on the same line is correct.  Putting it
on the next line leads to emacs auto-formatting moving it to the first
column, which should only have braces for the start of a function.

> !    which may be changed to a load.  The PowerOpen ABI says
> !    this is the same as R_POS. 
> ! */

Strictly speaking, the comment should end "R_POS.  */"

Please check for similar formatting errors in the rest of your patch.
There are many more.  See http://www.gnu.org/prep/standards_toc.html

Alan Modra


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